SSH still asking for password even after using ssh-agent on fossapup 9.5 (Solved)

Post here if you feel others can duplicate your so discovered "bug"

Moderator: Forum moderators

Post Reply
wanthinker
Posts: 33
Joined: Thu Mar 18, 2021 11:35 pm
Has thanked: 17 times
Been thanked: 1 time

SSH still asking for password even after using ssh-agent on fossapup 9.5 (Solved)

Post by wanthinker »

Now, I'm not sure if this is specifically related to the current puppy I'm using (fossapup 9.5) but it seems that, when setting up ssh-agent and adding the password of a target private key, ssh *still* ask for that same password, as if ssh-agent wasn't running (which it is...).

I used different variation of the same commandline which I'm used to and usually worked on other distros:

Code: Select all

eval "$(ssh-agent)" ; ssh-add ~/.ssh/privatekey

or

Code: Select all

eval `ssh-agent` ; ssh-add ~/.ssh/privatekey

or

Code: Select all

eval `ssh-agent -s` ; ssh-add ~/.ssh/privatekey

The privatekey above is just an example. The one i have does have a password which is why i want to do this. Strangely enough, the only time ssh-agent seems to work and ssh does not ask for the previously mentioned password is when doing an ssh tunnel like so:

Code: Select all

ssh -f user@ip -i ~/.ssh/privatekey -L port:localhost:port

Without ssh-agent, the above command does ask for the password of the privatekey, as per usual.
Beside that, every other ssh command that could be used with the privatekey still ask for password even with ssh-agent running like shown above (except for the ssh tunnel command shown above)...

eg: The following

Code: Select all

ssh user@ip -i ~/.ssh/privatekey

Ask for the password even with ssh-agent.

The above set of command work normally on other distros i tried, so I'm unsure as to why this doesn't work as expected, especially given i didn't see any error coming from ssh, even with the verbose flag.

EDIT: Seems like there is indeed an error, when running

Code: Select all

ssh-add -l

The following is shown:

Code: Select all

Could not open a connection to your authentication agent.

So I'm guessing ssh-add somehow can't "hook" itself to the running ssh-agent? Seems like it (even though it work fine on other distro for some reason)
Also does not explain why the ssh tunnel command above work without asking for password, but other ssh command using the privatekey does...

Last edited by wanthinker on Sun Mar 21, 2021 6:34 pm, edited 1 time in total.
s243a
Posts: 501
Joined: Mon Dec 09, 2019 7:29 pm
Has thanked: 90 times
Been thanked: 37 times

Re: SSH still asking for password even after using ssh-agent on fossapup 9.5

Post by s243a »

Just to be clear, is it the login password on the remote host that you are being asked for or the password to the private key store on your local machine? I'm guessing in the former case then it likely has to do with the configuration settings of the remote host (ssh server) and in the latter case it has to do with you properly initializing your ssh agent.

I could be wrong though. Perhaps the ssh agent also can deal with the former case but an alternative way around this would be to not require a login password on the remote machine (i.e. key only authentication).

wanthinker
Posts: 33
Joined: Thu Mar 18, 2021 11:35 pm
Has thanked: 17 times
Been thanked: 1 time

Re: SSH still asking for password even after using ssh-agent on fossapup 9.5

Post by wanthinker »

s243a wrote: Sat Mar 20, 2021 1:09 pm

Just to be clear, is it the login password on the remote host that you are being asked for or the password to the private key store on your local machine? I'm guessing in the former case then it likely has to do with the configuration settings of the remote host (ssh server) and in the latter case it has to do with you properly initializing your ssh agent.

I could be wrong though. Perhaps the ssh agent also can deal with the former case but an alternative way around this would be to not require a login password on the remote machine (i.e. key only authentication).

I mentioned it in my post but, as i said _it is the password from the privatekey_, not the login itself. The above commands in my post work perfectly on other distros, only found to not be working on puppies (eg: fossapup) for whatever reason.

wanthinker
Posts: 33
Joined: Thu Mar 18, 2021 11:35 pm
Has thanked: 17 times
Been thanked: 1 time

Re: SSH still asking for password even after using ssh-agent on fossapup 9.5

Post by wanthinker »

Nvm, managed to make it work. Here how i did it:

- (ssh-agent script i found)

Code: Select all

git clone https://github.com/intuited/sshag

- source sshag/sshag
- ssh-add privatekey
- DONE

To check if this work, one can use

Code: Select all

sshag

after sourcing it to see if any key is loaded...
Weird that i never had to use this on other distros, but at least this works now, SOLVED

s243a
Posts: 501
Joined: Mon Dec 09, 2019 7:29 pm
Has thanked: 90 times
Been thanked: 37 times

Re: SSH still asking for password even after using ssh-agent on fossapup 9.5

Post by s243a »

wanthinker wrote: Sat Mar 20, 2021 8:29 pm

Nvm, managed to make it work. Here how i did it:

- (ssh-agent script i found)

Code: Select all

git clone https://github.com/intuited/sshag

- source sshag/sshag
- ssh-add privatekey
- DONE

To check if this work, one can use

Code: Select all

sshag

after sourcing it to see if any key is loaded...
Weird that i never had to use this on other distros, but at least this works now, SOLVED

I'm curious. What led you to this tool? Was there some discussion that recommended it?

wanthinker
Posts: 33
Joined: Thu Mar 18, 2021 11:35 pm
Has thanked: 17 times
Been thanked: 1 time

Re: SSH still asking for password even after using ssh-agent on fossapup 9.5

Post by wanthinker »

s243a wrote: Sat Mar 20, 2021 11:08 pm
wanthinker wrote: Sat Mar 20, 2021 8:29 pm

Nvm, managed to make it work. Here how i did it:

- (ssh-agent script i found)

Code: Select all

git clone https://github.com/intuited/sshag

- source sshag/sshag
- ssh-add privatekey
- DONE

To check if this work, one can use

Code: Select all

sshag

after sourcing it to see if any key is loaded...
Weird that i never had to use this on other distros, but at least this works now, SOLVED

I'm curious. What led you to this tool? Was there some discussion that recommended it?

Nah, i just went to github, searched for "ssh agent" then used the filter "Shell" on the side...found it and tried it based on description :)
(given I'm decent in Shell scripting, i did check the script before running it first, which is recommended to do usually)

Post Reply

Return to “Bug Reports”