- 生成钥匙对
ssh-keygen -t rsa -C ss.topol.xyz -f ./bwg
- 将bwg.pub中的内容放到服务器/root/.ssh/authorized_keys文件中
- 编辑/etc/ssh/sshd_config文件
PasswordAuthentication no
- 保存并重启sshd服务 (centos7)
systemctl status sshd.service
systemctl restart sshd.service
#linux
ssh-keygen -t rsa -C ss.topol.xyz -f ./bwg
PasswordAuthentication no
systemctl status sshd.service
systemctl restart sshd.service
#linux