Click to See Complete Forum and Search --> : root access required
NewbieSteve
09-24-2001, 07:24 PM
I reciently installed Linux on my home PC. Various guides recommend NOT logging in as root unless needed to prevent accidental damage. However, I have noticed that I cannot mount the CD or Floppy drives without root access. I also cannot issue the shutdown -h now command when I am logged in as steve.
These would seem to be routine tasks that any user should be able to do. Is there a standard procedure for this kind of thing?
Thanks
Dark Ninja
09-24-2001, 07:29 PM
Not really, unless you use a program called 'sudo' but this involves typing a password, so it's about the same as typing 'su.' There's no damage in shutting down under root. The reason that books suggest not logging in under root all the time is: 1.) Root has access to everything on a system and so does the processes that he runs. If he runs a virus or a trojan horse, you are screwed. 2.) It is very easy to delete or otherwise destroy your files with a simple command.
But, no problem in just running 'su' for simple, everyday tasks.
Dark Ninja
NewbieSteve
09-24-2001, 07:43 PM
OK, thats fine, whatever works.
But, suppose you were in a multi user environment. Only one person has root access, but others have floppy disks and CDs that they want to use.
Do they call the sys. admin. evry time?
X_console
09-24-2001, 07:57 PM
In a multiuser system, it would be very risky to allow everyone to mount floppies and CDs unless the person mounting the floppies/CDs was doing it on their own system. If you can trust the persons using the system, then you need to modify /etc/fstab and add the "user" option. Eg:
/dev/cdrom /cdrom iso9660 defaults,user,noauto 0 0
NewbieSteve
09-25-2001, 02:02 PM
ok, that works for the mounting. Now, about shutdown; is it assumed in a Linux environment that the machine will be left on all the time? If one of my kids, for example, wants to shut down Linux to load Windows, do they need root access?
Does it sound like a good idea to give my kids the root password :confused:
Have you tried the "halt" or "reboot" commands? I don´t know if they´re redhat specific but I´m sure you can call them without being root.
(halt will halt and reboot will reboot) :)
X_console
09-25-2001, 03:56 PM
halt and reboot can only be run by root. Otherwise people who can ssh or telnet into the system can take it down. If you and your family are the only ones using the system, and aren't allowing anyone else to login from a remote system, then you can make shutdown SUID. As root type:
chmod 4755 $(which shutdown)
You can do the same for halt and reboot too if you like.
jon787
09-25-2001, 04:46 PM
Ctrl+Alt+Del is what I use to reboot. Works fine even when I'm not even logged in. Doesn't work from X though, only the command line.
Should this be a security concern or is that one of the things that can only be used when you are actually at the computer (not remotely logged in)?
NewbieSteve
09-26-2001, 11:31 AM
Thanks folks, things are looking better. Just to clear things up a bit though; why would it be risky to let users mount the floppy and CD drives?
Also, are there other functions that would apear common to a Windows user which would require root access under Linux?