免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 17475 | 回复: 5
打印 上一主题 下一主题

如何限制ssh用户同时登陆的数量 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-03-10 10:05 |只看该作者 |倒序浏览
如何限制ssh用户同时登陆的数量?

修改了/etc/ssh/sshd_config下的
MaxStartups 2
没有作用

修改了/etc/security/limits.conf 这个文件
@ssh        -       maxlogins       4
并修改了/etc/pam.d/sshd这个文件中的
session    required     pam_limits.so
没有作用

小弟用的是Description:    Red Hat Enterprise Linux Server release 5.5 (Tikanga)
请各位大神出来帮忙解决

论坛徽章:
0
2 [报告]
发表于 2012-03-29 13:55 |只看该作者
我也遇到了同样的问题   正在研究   

论坛徽章:
13
技术图书徽章
日期:2014-04-29 14:15:42IT运维版块每日发帖之星
日期:2015-12-12 06:20:00IT运维版块每日发帖之星
日期:2015-08-30 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-08-02 06:20:002015年亚洲杯之澳大利亚
日期:2015-04-03 15:03:12申猴
日期:2015-03-20 09:00:292015年迎新春徽章
日期:2015-03-04 09:54:452015年辞旧岁徽章
日期:2015-03-03 16:54:15季节之章:冬
日期:2015-01-20 17:08:47双子座
日期:2014-11-21 16:30:31技术图书徽章
日期:2014-07-11 16:29:08
3 [报告]
发表于 2012-03-29 14:07 |只看该作者
本帖最后由 dengbao2001 于 2012-03-29 14:34 编辑

/etc/ssh/sshd_config

sshd reads configuration data from /etc/ssh/sshd_config (or the file
     specified with -f on the command line).  The file contains keyword-argu-
     ment pairs, one per line.  Lines starting with `#' and empty lines are
     interpreted as comments.  Arguments may optionally be enclosed in double
     quotes (") in order to represent arguments containing spaces.

     The possible keywords and their meanings are as follows (note that key-
     words are case-insensitive and arguments are case-sensitive):

MaxSessions
             Specifies the maximum number of open sessions permitted per net-
             work connection.  The default is 10.

此参数现在每台电脑的最大会话数

论坛徽章:
0
4 [报告]
发表于 2012-03-29 14:20 |只看该作者
楼上的   还是不太明白    能 否详细点说的????

论坛徽章:
0
5 [报告]
发表于 2012-03-29 20:03 |只看该作者
同求,挂了好多天了,还没有人回答呢

论坛徽章:
0
6 [报告]
发表于 2012-03-29 21:04 |只看该作者
修改/etc/ssh/sshd_config配置文件
将"MaxSessions 10"改为适当的值。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP