客户端机器生成公私密钥对

ssh-keygen -t rsa

上传id_rsa.pub到服务器,并将其中内容追加到authorized_keys文件中

然后设置服务器端sshd,更改后

PasswordAuthentication no

PubkeyAuthentication yes

重启服务器端ssh服务即可

Leave a Reply

Your email address will not be published. Required fields are marked *