OpenSSH : Use SSH-Agent

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]. This is some example to use SSH-Agent.

# run SSH-Agent

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

Agent pid 1486

# add passphrase

[cent@dlp ~]$ ssh-add

Enter passphrase for /home/cent/.ssh/id_rsa:

Identity added: /home/cent/.ssh/id_rsa (cent@dlp.srv.world)

# verify

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

2048 SHA256:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx cent@dlp.srv.world (RSA)

# try to conenct wuthout inputting passphrase

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

node01.srv.world

# stop SSH-Agent

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

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

Agent pid 1486 killed

Comments

Popular posts from this blog

Java : Variables Declaring

Install DNF in RHEL/CentOS 7

SQL Self JOIN