客户端生产密钥

  1. ssh-keygen -t rsa

上传到服务端

  1. scp ~/.ssh/id_rsa.pub root@192.168.0.17:
  2. scp ~/.ssh/id_rsa.pub root@192.168.0.18:
  3. scp ~/.ssh/id_rsa.pub root@192.168.0.19:

写入

  1. cat id_rsa.pub >> ~/.ssh/authorized_keys

配置文件修改

  1. vim /etc/ssh/sshd_config
  2. UseDNS no
  3. GSSAPIAuthentication no
  4. ClientAliveInterval 600
  5. ClientAliveCountMax 10

重启

  1. service sshd restart

解决Enter passphrase for key

  1. eval `ssh-agent`
  2. ssh-add
  1. #Linux centos重启命令:
  2. reboot 普通重启
  3. shutdown -r now 立刻重启(root用户使用)
  4. shutdown -r 10 10分钟自动重启(root用户使用)
  5. shutdown -r 20:35 在时间为20:35时候重启(root用户使用)
  6. # 如果是通过shutdown命令设置重启的话,可以用shutdown -c命令取消重启
  7. # Linux centos关机命令:
  8. halt 立刻关机
  9. poweroff 立刻关机
  10. shutdown -h now 立刻关机(root用户使用)
  11. shutdown -h 10 10分钟后自动关机
  12. # 如果是通过shutdown命令设置关机的话,可以用shutdown -c命令取消重启