- 论坛徽章:
- 8
|
问一个安全方面问题。。。。
在SHELL命令行模式下执行 sh -r、 ksh -r 实质是开启了一个新的SHELL,exit 退出后又会回到原来的用户SHELL下。
解决办法就是从根本上下手,更改/etc/passwd中用户的SHELL信息为 /bin/ksh -r
如果要彻底限制用户的登录的话,简单的办法还有更改/etc/passwd中SHELL信息为一个SHELL命令(非SHELL本身),如/usr/bin/logout,这样用户一登录即先执行在/etc/passwd里面设定的SHELL。
-r 选项限制的还不止这个呢:
-r Runs a restricted shell. With a restricted shell you cannot:
o Change the current working directory.
o Set the value of the SHELL, ENV, or PATH variable.
o Specify the pathname of a command that contains a / (slash).
o Redirect output of a command with >; (right caret), >;| (right caret, pipe symbol), <>; (left caret, right caret), or >;>; (two right carets). |
|