一 ssh的两种登录方式
1密码登录:
[root@westos Desktop]# ssh root@192.168.122.26
Address 192.168.122.26 maps to bogon, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
root@192.168.122.26's password:
Last login: Tue Jan 17 13:27:29 2017 from 192.168.122.1
2公钥密钥登录
客户端连接服务器时候会生成.ssh目录,此时保证客户端下生成.ssh目录
第一步服务器端生成公钥和密钥
查看.ssh文件下的内容;
第二步:服务器添加认证
第四步:服务器分发私钥给客户端
完成之后就可以让指定IP的客户端不用密码连接
二ssh的配置
在服务器的/etc/ssh/sshd_cinfig文件下可以管理ssh服务:
PasswordAuthentication yes/on ----------------------> 开启或者关闭密码连接
PermitRootLogin yes/no ----------------------------->允许超级用户登录
AllowUsers student----------------------------->只允许登录的用户
DenyUsers student-------------------------->不允许登录的用户