linux-设置密钥验证登陆并禁用密码登陆

Hanze | May 31, 2022 min read
  1. 生成钥匙对 ssh-keygen -t rsa -C ss.topol.xyz -f ./bwg
  2. 将bwg.pub中的内容放到服务器/root/.ssh/authorized_keys文件中
  3. 编辑/etc/ssh/sshd_config文件 PasswordAuthentication no
  4. 保存并重启sshd服务 (centos7) systemctl status sshd.service systemctl restart sshd.service

#linux

comments powered by Disqus