Sponsored Link

OpenSSH : Use SSH-Agent2021/07/19

Use SSH-Agent to automate inputting Passphrase on SSH Key Pair authentication.
Using SSH-Agent is valid for users who set SSH Key Pair with Passphrase.
[1] Follows are some examples to use SSH-Agent.
# run SSH-Agent

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

Agent pid 1623
# add passphrase

[rocky@dlp ~]$

Enter passphrase for /home/rocky/.ssh/id_rsa:
Identity added: /home/rocky/.ssh/id_rsa (
# verify

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

3072 SHA256:3f+NQ4SaEtBeF+PosfbNF5KbmiJ+S8uv9Lw+L2kWlHw (RSA)
# try to conenct without inputting passphrase

[rocky@dlp ~]$
ssh hostname
# stop SSH-Agent

# if not execute it, SSH-Agent process remains even if you logout System, be careful

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

Agent pid 1623 killed
Matched Content