LINK="#3366FF" VLINK="#A000A0">

"The Linux Gazette...making Linux just a little more fun!"


(?) The Answer Guy (!)


By James T. Dennis, tag@lists.linuxgazette.net
Starshine Technical Services, http://www.starshine.org/


(?) More on: "Remote Login as root"

From Eric Freden on Fri, 04 Dec 1998

(?) Here is a legitimate use for remote login as root:

My kid plays some svga game on my console and locks the keyboard (for instance). I want to telnet in and /sbin/shutdown -r now

(!) Actually you can often recover from this without a shutdown. But its a trick. Eventually we might have something like KGI/GGI to provide more robust SVGAlib support.
(The trick is to start X from your telnet/terminal session. This usually does a complete video system reset as a side effect. WARNING!: This might hang the system --- so close any running text mode apps, save any accessible documents and issue a few calls to 'sync' before trying it).

(?) For RedHat 5.0 (and all other RedHat versions I've used) only root can do this. Changing to su and executing shutdown won't reboot! Perhaps you could find a workaraound for this scenario?

Eric Freden

(!) If that's your experience then something is wrong with your 'su' command!
Did you issue 'su -' (the dash is pretty important --- as it forces the 'su' command to run your .login/.profile scripts and initialize root environment (and shell variables, etc).
Another approach is to tweak the permissions on 'shutdown' Here's the recommended method:
Create a group such as "shutdown" or use the "wheel" group.
Add your regular user account (and mom's?) to that group.
Issue a command like:
chown root.$GROUP $(which shutdown)
... to set the file group association appropriately. You could also use 'chown' then 'chgrp' seperately, of course.
Make it SUID with a command like:
chgrp 4550 $(which shutdown)
N.B. I set the execute bit for owner and group but not for "other/world"
This allows people in the associated group to issue the 'shutdown' command. That command will run with root' privileges. The 0 permissions for "other" prevent "others" from executing this command at all. (Other users have no valid reason to issue a shutdown command).
Setting binaries to be SUID always has implications for system security. However, it is one of the primary forms of authority delegation available in Unix/Linux.
In this case we minimize the risk by limiting the number of accounts that can access the command.
This technique is generally useful and should be considered for all Unix/Linux SUID commands.


Copyright © 1999, James T. Dennis
Published in The Linux Gazette Issue 36 January 1999


[ Answer Guy Index ] a b c 1 2 3 4 5 6 7 9 10 11 12
15 16 18 19 20 21 22 23 24 25 26 27 28
29 31 32 33 34 35 36 37 38 39 40 41 42 44
45 46 47 48 49 50 51 52 53 54 55 56 57 60 61 62 63 64 65 66
67 69 72 76 77 78 79 80 81 82 84 85 86 87 91 94 95 96 97 98


[ Table Of Contents ] [ Front Page ] [ Previous Section ] [ Next Section ]