Linux給普通使用者新增ssh許可權

a564100發表於2017-04-26

  當我們建立好一個普通使用者後,就一定會面臨使用者無法通過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

  

轉載於:https://www.cnblogs.com/caolicangzhu/p/6766970.html

相關文章