客户端生产密钥
ssh-keygen -t rsa
上传到服务端
scp ~/.ssh/id_rsa.pub root@192.168.0.17:scp ~/.ssh/id_rsa.pub root@192.168.0.18:scp ~/.ssh/id_rsa.pub root@192.168.0.19:
写入
cat id_rsa.pub >> ~/.ssh/authorized_keys
配置文件修改
vim /etc/ssh/sshd_configUseDNS noGSSAPIAuthentication noClientAliveInterval 600ClientAliveCountMax 10
重启
service sshd restart
解决Enter passphrase for key
eval `ssh-agent`ssh-add
#Linux centos重启命令:reboot 普通重启shutdown -r now 立刻重启(root用户使用)shutdown -r 10 过10分钟自动重启(root用户使用)shutdown -r 20:35 在时间为20:35时候重启(root用户使用)# 如果是通过shutdown命令设置重启的话,可以用shutdown -c命令取消重启# Linux centos关机命令:halt 立刻关机poweroff 立刻关机shutdown -h now 立刻关机(root用户使用)shutdown -h 10 10分钟后自动关机# 如果是通过shutdown命令设置关机的话,可以用shutdown -c命令取消重启