cd ~/.ssh #没有则需要创建一个。 mkdir ~/.ssh ssh-keygen -t rsa cd ~/.ssh scp id_rsa.pub root@IP地址:~/.ssh/id_rsa.pub ssh root@IP地址 cd ~/.ssh cat id_rsa.pub >> authorized_keys rm id_rsa.pub exit