用rsh实现关机用户

2009-05-13 01:23:43来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折


                Last time I mentioned that I saw a "Shutdown" user account on a Solaris machine. I didnot see how it worked, however, only to guess that rsh might be of use. Today I tried to work out that on my FreeBSD5.3 box and got it in a freebsd way. Firstly, rshd must start. Then .rhosts should be built under root''s home directory, with the shutdown account authenticated like,     localhost shutdownYet what frustrated me is that root seemed not able to be accessed through rsh. After more scrutination of the rshd manpage, I managed to get root accessible by modifing /etc/pam.d/rsh file at the line,    auth  required  pam_rhosts.so  no_warn  allow_rootallow_root is added to make root accessible through rsh! Then the only thing left is to add "rsh localhost -l root init 0" to shutdown-account''s .profile. Here a just normal priviliege setting is required for the shutdown-account. Actually you donot need to make an account to login. A script is also applicable to normal users. And in the other way, during the time I was making my way out, I also find some other ways for a shutdown-accout. Most are endowed with root equivalent privilieges. For example, the simplest is to make a root equivalent account and add shutdown script to its .profile. Another way is to edit /etc/passwd to modify normally /bin/sh field to a shutdown script. Either should be ok. I havent tried them, however. Yet what is indisputable is that security might be, more or less, a problem, in all the above shutdown-accout implementations.
               
               


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/8091/showart_42199.html

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:FreeBSD扫盲之apache+php+ZendOptimizer简单安装、设置

下一篇:昨天把freebsd分区扩大到10G