0

I accidentally killed my ssh-agent, how do I restart it without having to reconnect ?

I tried this but it does not work :

$ eval $(ssh-agent -s)
Agent pid 8055

Then, I open a new Gnome terminal with CTRL+SHIFT+N from the previous terminal window and type :

$ ssh-add
Could not open a connection to your authentication agent.

But if I open a new Gnome terminal from my first Gnome terminal by typing :

$ gnome-terminal &

then this new window is able to connect to the ssh-agent.

Is it not possible for all my Gnome terminals to "see" the ssh-agent without having to reconnect to the PC/server ?

0

Try restart using the following command:

sudo service ssh restart

The private/public RSA SSH keys are located in ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub, respectively. You can transfer the public key to another machine to connect to it through public key authentication. This can be done via ssh-copy-id like so:

ssh-copy-id username@host

Or you can append your public key (id_rsa.pub) to the server's /home/username/.ssh/authorized_keys file, which is in essence what ssh-copy-id does.

  • This command does not restart the ssh-agent, it only restarts the ssh service – SebMa May 12 at 22:07
0

This doesn't work as you supposed. ssh-agent overwrites the configuration.

TO FIX THIS---

Find agent:

`eval "$(ssh-agent -s)"`

Agent pid 9546

Kill PID:

`kill -9 9546`

THEN YOU CHECK

ssh git@gitlab.com-test

ssh git@gitlab.com

It should work now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.