SSH 連線設定使用某帳號登入ssh 以及限制某一網域登入
 
1.限制root 登入,修改/etc/ssh/sshd_config
 
[root@linux ~]# vi /etc/ssh/sshd_config
PermitRootLogin no     <== 將他改成 no !
2.不許某個群組登入

1. 將這些使用者都歸納在某一個特殊群組之下,例如 nossh 這個群組好了;
2. 在 /etc/ssh/sshd_config 當中加入這一行:『 DenyGroups  nossh
3. 重新啟動 sshd : /etc/rc.d/init.d/sshd restart

 

3.不許某個使用者登入
跟 DenyGroups 類似,使用 DenyUsers 即可!參考 sshd_config 的設定喔!

 

4.以 /etc/hosts.allow 及 /etc/hosts.deny 限制

[root@linux ~]# vi /etc/hosts.allow
sshd: 192.168.0.1, 192.168.0.2

[root@linux ~]# vi /etc/hosts.deny
sshd :.sample.com

 

 

 

arrow
arrow
    全站熱搜

    奔騰兔 發表在 痞客邦 留言(0) 人氣()