Gangmax Blog

How to use SSH public key authentication

Using SSH public key anthentication makes the SSH login process securer and easier, that you don’t need to remember the password.

From here.

First make sure you have the local SSH “private/public keypair” ready. If not, run “ssh-keygen” to create.

Then you just need to run the following command:

1
2
3
4
# "x.x.x.x" is the target host, "username" is the login account on the host.
# After you input your password and login, it's all set. From now on you
# don't need to input password when running "ssh username@x.x.x.x".
ssh-copy-id username@x.x.x.x

Comments