I'm on a Raspberry running Raspbian GNU/Linux 11 (bullseye). Im stuck with a strange behaviour. After booting, ps -ef | grep ssh says
root 482 1 0 16:03 ? 00:00:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
pi 605 555 0 16:04 ? 00:00:00 /usr/bin/ssh-agent x-session-manager
pi 724 1 0 16:04 ? 00:00:00 /usr/bin/ssh-agent -s
root 780 482 0 16:04 ? 00:00:00 sshd: pi [priv]
pi 795 780 0 16:04 ? 00:00:00 sshd: pi@pts/0
pi 1038 796 0 16:06 pts/0 00:00:00 grep --color=auto ssh
If I enter ssh-add ~/.ssh/id_rsa I receive Could not open a connection to your authentication agent. Same if I use sudo.
As read from other discussions I enter eval ssh-agent -s and then I am able to do ssh-add, but now I have ssh-agent twice in memory:
root 482 1 0 16:03 ? 00:00:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
pi 605 555 0 16:04 ? 00:00:00 /usr/bin/ssh-agent x-session-manager
pi 724 1 0 16:04 ? 00:00:00 /usr/bin/ssh-agent -s
root 780 482 0 16:04 ? 00:00:00 sshd: pi [priv]
pi 795 780 0 16:04 ? 00:00:00 sshd: pi@pts/0
pi 1048 1 0 16:10 ? 00:00:00 ssh-agent -s
pi 1050 796 0 16:11 pts/0 00:00:00 grep --color=auto ssh`
- What starts the first agent? I've looked for .bashrc and .profile, but there no agent is started.
- Why can't I connect to the first agent, although both are started by pi?
- Does it matter to have the agent twice in memory? Is it good, is it bad?
Thanks for any help
x-session-managerso it's probably started with X server and separated from your SSH session. – Panki Jul 26 '22 at 19:47