Use Rsa log to SSH

#create keygen at local

#use command

$ ssh-keygen -t rsa -b 2048

Add ssh key to server copy keygen at ~/.ssh/id_rsa.pub.

On server

create .ssh directory with  permission is 755 at folder ~

touch ~/.ssh/authorized_keys2

#quick copy rsa key to ssh on server
ssh-copy-id ‘-p XXXX -i ~/.ssh/id_rsa.pub username@host’

add public key to authorized_keys2

change mode from 644 to 400

if edit , you must change mod file authorized_keys2 to 644,

when finish, make sure permission of .ssh is 700 , authorized_keys2 is 400.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s