Chinaunix首页 | 论坛 | 博客
  • 博客访问: 636635
  • 博文数量: 137
  • 博客积分: 6189
  • 博客等级: 准将
  • 技术积分: 1559
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-15 16:39
文章分类

全部博文(137)

文章存档

2010年(3)

2009年(1)

2008年(49)

2007年(56)

2006年(28)

分类: LINUX

2007-07-23 11:19:32

vi /etc/pam.d/sshd
加入一行 account required pam_access.so  
退出保存
vi /etc/security/access.conf
在尾行加入一行-: guest : ALL EXCEPT 192.168.0.
意思是guest用户从任何的IP地址都不能访问除了192.168.0. 这网段
保存退出
然后测试  # ssh     可以登陆
          # ssh       不可以登陆
以下为文件的注释
permission : users : origins                                                       大概的意思是
#
# The first field should be a "+" (access granted) or "-" (access denied)
# character.
#
# The second field should be a list of one or more login names, group
# names, or ALL (always matches). A pattern of the form is
# matched when the login name matches the "user" part, and when the
# "host" part matches the local machine name.
#
# The third field should be a list of one or more tty names (for
# non-networked logins), host names, domain names (begin with "."), host
# addresses, internet network numbers (end with "."), ALL (always
# matches) or LOCAL (matches any string that does not contain a "."
# character).
以上的大概意思是
第一个打头的如果为+号(表示准许连接)如果为-号(表示拒绝连接)
第二个应该是你远程TTY的名字也就是说你远程的登陆名字或者组名 ALL(表示匹配所有),你可以在终端输入
其中user是匹配登陆的名host表示你本机器的IP地址
第三是列出你的登陆名字,或者是网络名,域名别忘记后边要加上点。

本人英语不是很好以上为基本大意如果有问题请多指教共同进步
阅读(1213) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~