E
E
Evgeny Zalivadny2021-08-25 14:32:18
SSH
Evgeny Zalivadny, 2021-08-25 14:32:18

How to add private key to SSH Agent permanently?

Each time before connecting to a remote server, I have to execute the command ssh-add ~/.ssh/keyto forward the key to this connection and have access to an external remote resource (in relation to the remote machine). How to make it permanent so as not to repeat this action every time?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
Evgeny Zalivadny, 2021-08-27
@Nordihan

The problem was solved by moving the keys to the root ~/.ssh from the subfolder.
After a reboot, they themselves are added to the agent.

N
neol, 2021-08-25
@neol

If I'm not mistaken, then the key must be written in ~/.ssh/config in the form

Host remote.com
   IdentityFile ~/.ssh/remote.com.key

where remote.com is the first server you connect to

I
Ivan Koryukov, 2021-08-25
@MadridianFox

Register adding a key to the agent in autoload.

A
Alexander Karabanov, 2021-08-26
@karabanov

You can add the key to the keychain ("Passwords and Keys" application in English seahorse ) and the key will be added to the agent at the time of logging into the system, there will be no need to enter the password separately from the key.
xrbjiizab4ufkk2hatlxt9msc24.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question