启用ssh的公钥连接,禁用密码连接

系统

ubuntu 16.04 64bit

步骤
  1. 服务器的~/目录新建文件夹.ssh,权限0700
  2. 上传公钥到服务器的~/.ssh/目录,重命名为authorized_keys,权限为0644
  3. 编辑/etc/ssh/sshd_config
  4. PubkeyAuthentication yes
    PasswordAuthentication no
  5. 重启服务器
  6. reboot
  7. 愉快的玩耍吧~
  8. ssh -i [PrivateKey] [root@]server

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注