主题 : 禁止一些用户的Telnet权限
千山同一月 万户尽皆春 千江有水千江月 万里无云万里天
级别: 总版主

UID: 998
精华: 0
发帖: 604963
威望: 528524 点
无痕币: 3089 WHB
贡献值: 0 点
在线时间: 61670(时)
注册时间: 2008-12-25
最后登录: 2024-03-28

0 禁止一些用户的Telnet权限

在/etc/pam.d/login中添加:
auth required /lib/security/pam_listfile.so item=user sense=deny file=
/etc/login_deny onerr=succeed
然后在/etc/中添加login_deny文件,里面添上所要禁止
的用户名即可。


1.写一个shell script /bin/ftponly:
#!/bin/sh
/bin/cat << XX
You can only use FTP on this computer,
but you may not use this account to login.
Connection will be closed in 10 seconds.
XX
/usr/bin/sleep 10
#end of ftponly
2.把用户ftponly的shell设置成/bin/ftponly:
到passwd文件,找到对应于ftponly的那行
ftponly:......:/home/ftponly:/bin/bash,把最后的
/bin/bash改为/bin/ftponly.
3.把 /bin/ftponly 加入到 /etc/shells
/bin/bash
/bin/tcsh
/bin/csh
/bin/ash
/bin/zsh
/bin/ftponly
就行了:-)))))
级别: 十方秋水

UID: 26730
精华: 0
发帖: 64722
威望: 148036 点
无痕币: 183 WHB
贡献值: 0 点
在线时间: 11530(时)
注册时间: 2008-05-03
最后登录: 2018-05-16

学习一下了
Total 0.275611(s) query 4, Time now is:03-28 20:54, Gzip enabled 粤ICP备07514325号-1
Powered by PHPWind v7.3.2 Certificate Code © 2003-13 秋无痕论坛