转自:阮一峰的个人网站

ssh-keygen
ssh-copy-id user@host

1,在$HOME/.ssh/目录下,会新生成两个文件:id_rsa.pub和id_rsa
2,将公钥传送到远程主机host上面

That's all. :wink: