您好,欢迎来到悍铭数据中心!

新闻中心

用rsh实现关机用户

 
                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.

香港云主机