2013年2月21日 星期四

[SSH] How to ssh without password

Generate a rsa keypair:
# ssh-keygen (Local machine create rsa keypair)

Generate two key (private and public key)

Your identification has been saved in ~/.ssh/id_rsa
Your public key has been saved in ~/.ssh/id_rsa.pub


then copy it on the server with one simple command:

# ssh-copy-id Remote_Account@Remote_IP_Address (ex : ssh-copy-id root@192.168.100.100)
or
cat ~/.ssh/id_rsa.pub to <Remote Server> .ssh/authorized_keys


Check -- you can now log in without password:
# ssh hostname (ex : ssh root@192.168.100.100 or ssh 192.168.100.100 -l root)


Reference :

0 意見:

張貼留言