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

Comments