CentOS Stream 10
Sponsored Link

OpenSSH : Use SSH-Agent2024/12/19

 

Use SSH-Agent to automate inputting Passphrase on SSH Key Pair authentication.
SSH-Agent is useful for users who set SSH Key Pair with Passphrase.

[1] This is some example to use SSH-Agent.
# run SSH-Agent

[cent@dlp ~]$
eval $(ssh-agent)

Agent pid 2069
# add passphrase

[cent@dlp ~]$
ssh-add

Enter passphrase for /home/cent/.ssh/id_ed25519:
Identity added: /home/cent/.ssh/id_ed25519 (cent@dlp.srv.world)
# verify

[cent@dlp ~]$
ssh-add -l

256 SHA256:SDnILWXo7aKWGF4trcAUabqmjOkesMICFPHrFmotTo0 cent@dlp.srv.world (ED25519)

# try to connect without inputting passphrase

[cent@dlp ~]$
ssh node01.srv.world hostname

node01.srv.world
# stop SSH-Agent

[cent@dlp ~]$
eval $(ssh-agent -k)

Agent pid 2069 killed
Matched Content