sudo apt-get update
sudo apt-get install openssh-server
1:ssh-keygen -t rsa -f ~/.ssh/id_rsa
这里会提示输入pass phrase,一定不要输入任何字符,回车即可
2:cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
3:ssh localhost
4:如果还要提示输入密码,请修改:
chmod 600 ~/.ssh/authorized_keys