#生成rsa
ssh-keygen -t rsa
#按需修改,默認即可
#複製SSH密鑰到目標主機,開啓無密碼SSH登錄
ssh-copy-id user@host
#本地主機ssh遠程服務器
ssh -v root@遠程服務器IP
#注意 SSH相關的配置在/etc/ssh/sshd_config
#可以控制是否允許登錄
#允許root認證登錄
PermitRootLogin yes
#允許密鑰認證
RSAAuthentication yes
PubkeyAuthentication yes
#默認公鑰存放的位置
AuthorizedKeysFile .ssh/authorized_keys