當我們創建好一個普通用戶后,就一定會面臨用戶無法通過xshell登陸ssh的問題!
本文就教大家如何給普通用戶添加ssh登錄權限.
1.編輯/etc/ssh/sshd_config文件.
輸入命令:"vim /etc/ssh/sshd_config"
添加配置項AllowUsers:username1 username2
(也可以添加用戶組:AllowGroups:group1 group2)
2.重啟sshd服務器.
輸入命令:"/etc/init.d/ssh restart"
3.設置完成,嘗試用xshell登陸!
額外說明:
如果想拒絕用戶,或者用戶組ssh登陸ssh,則:
添加DenyUsers:username或者DenyGroups:groupname,寫法與上面類似
最后給出整個系列配置的優先級:DenyUsers>AllowUsers>DenyGroups>AllowGroups
