[Linux] 如何限制只有某帳號可以登入 SSH ?



贊助商連結


bjc4100
2002-06-02, 05:54 PM
各位大大:

請問 Linux 下如何限制只有某些帳號可以登入 SSH ?

謝謝!

贊助商連結


anson lin
2002-06-04, 06:06 PM
你好像post錯版了耶,應該要到Linux討論區喔 !!
但是還是回答你,希望你以後要多加注意呦 :)
你可以去 vi /etc/hosts.allow 和vi /etc/hosts.deny 把你要開放的ssh連線key進去,再去hosts.deny把所有連線都deny起來
:eek: :eek: :eek:

gwochern
2002-06-04, 07:43 PM
最初由 anson lin 發表
你好像post錯版了耶,應該要到Linux討論區喔 !!
但是還是回答你,希望你以後要多加注意呦 :)
你可以去 vi /etc/hosts.allow 和vi /etc/hosts.deny 把你要開放的ssh連線key進去,再去hosts.deny把所有連線都deny起來
:eek: :eek: :eek:

hosts.allow和hosts.deny是IP限制與開放的兩個檔案
他問的是帳號....
這個我也不知道,有誰知道SSH如何限制特定帳號,不讓他進入

mrj
2002-06-06, 10:49 AM
AllowUsers
This keyword can be followed by a list of user name patterns,
separated by spaces. If specified, login is allowed only for
users names that match one of the patterns. `*' and `'? can be
used as wildcards in the patterns. Only user names are valid; a
numerical user ID is not recognized. By default, login is
allowed for all users. If the pattern takes the form USER@HOST
then USER and HOST are separately checked, restricting logins to
particular users from particular hosts.