LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 08-23-2004, 04:40 PM   #1
zwyrbla
Member
 
Registered: Aug 2004
Location: MA
Distribution: Slack 10.1
Posts: 107

Rep: Reputation: 15
Why not stay as root?


I am using slackware 10 and I have found that almost all the problems im having are because im a user and I don't have permission to access anything. I have found that when logged in as root I can do anything I want and life is much easier. So basically why is using root for everyday use so terrible and if it really is so terrible how do i give my user account more permissions. thanks.
 
Old 08-23-2004, 04:49 PM   #2
trey85stang
Senior Member
 
Registered: Sep 2003
Posts: 1,091

Rep: Reputation: 41
Re: Why not stay as root?

Quote:
Originally posted by zwyrbla
I am using slackware 10 and I have found that almost all the problems im having are because im a user and I don't have permission to access anything. I have found that when logged in as root I can do anything I want and life is much easier. So basically why is using root for everyday use so terrible and if it really is so terrible how do i give my user account more permissions. thanks.
when you are typing rm -rf /home/something/somehting... and acidently hit the enter key after you type rm-rf / you will know why you should not run as root....


second you are more prone to have your system owned if you run as root by certain exploits etc.... blah blah...

its unsafe.. but then again its your system do as your please.
 
Old 08-23-2004, 04:51 PM   #3
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,164

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Staying as root is a bad idea because (a) it's a security hazard and (b) it's easy to hose your system as root. Basically, if you stay as root, every time you launch a web browser or an FTP client or an IRC session, it also runs with root priviliges, and if there's a bug in that application that allows it to execute malicious code from the Internet .... well, you're screwed. If you were running as a normal user, then the malicious code couldn't do anywhere near as much damage (though it would still give you a bad day). As for point (b), suppose one day you type

Code:
rm -rf / home/user/olddir
when you meant rm -rf /home/user/olddir (note the extra space). Congratulations, you just turned your machine into a toaster. You win a chance to reinstall the OS from scratch (or from tape backup). If you were running as a user, you'd just get a permission denied error.

Remember, permissions are your friends, not your enemies. You can use sudo to easily execute commands with root priviliedges when you need them. Or just su to root on occasion. Once you're box and all the software you want has been installed, you really shouldn't need root that much. I've gone for a week or more without becoming root on my primary workstation, and I become root usually only to install software or run a packet sniffer on my home LAN.
 
Old 08-23-2004, 04:57 PM   #4
zwyrbla
Member
 
Registered: Aug 2004
Location: MA
Distribution: Slack 10.1
Posts: 107

Original Poster
Rep: Reputation: 15
thanks i understand why not to know but how do I give my user account permission such as mounting devices?
 
Old 08-23-2004, 05:18 PM   #5
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
for mounting devices, edit /etc/fstab (as root).
add "user" to the options for each device you want users to mount.
example:
Code:
/dev/fd0             /mnt/floppy        auto       noauto,user,sync      0 0
 
Old 08-23-2004, 05:20 PM   #6
zwyrbla
Member
 
Registered: Aug 2004
Location: MA
Distribution: Slack 10.1
Posts: 107

Original Poster
Rep: Reputation: 15
what if i want access to certain directories such as /usr/local/ like for installing programs
 
Old 08-23-2004, 05:23 PM   #7
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
I'd suggest typing "su" followed by root password...install your application and then exit root. It takes 3 seconds.
 
Old 08-23-2004, 05:33 PM   #8
zwyrbla
Member
 
Registered: Aug 2004
Location: MA
Distribution: Slack 10.1
Posts: 107

Original Poster
Rep: Reputation: 15
but how do i install from the command line?
 
Old 08-23-2004, 05:50 PM   #9
b0ng
LQ Newbie
 
Registered: Aug 2004
Location: Location??? Where I am is top secret, if I tell you, I have to kill you.
Distribution: College, Slack
Posts: 24

Rep: Reputation: 15
There is another way to install software other than on the command line???
Oh snap. I always do in on the command line.

It is just bad juju to do everything as root, to many things can go wrong. One wrong stroke of the keyboard and your all jacked up, also when your running as root, if someone gets control of your account, you can consider yourself pwned. You are officially shit.

The last reason I never use root, is simply because of organization, if you want to keep your computer organized, or rather force you to keep your stuff organized you have to use root, I have a very large book collection on my computer about computers, well I install them as a regular user, and keep them organized as a regular user, so that I can find them. If I ran everything as root, they would all be in root's home directory.

Another reason it's bad to do everything as root, it makes admining your system such a pain, you have to go back and chmod everything if you want another user to see, or touch anything. It can get pretty ugly. I ran everything as root for 1 month to see something, my system looked so jacked up, I just reinstalled the darn OS.
 
Old 08-23-2004, 05:55 PM   #10
zwyrbla
Member
 
Registered: Aug 2004
Location: MA
Distribution: Slack 10.1
Posts: 107

Original Poster
Rep: Reputation: 15
also i added the line
/dev/sda /mnt/usb auto user 0 0
to fstab and i am still not allowed access to mnt/usb
 
Old 08-23-2004, 06:11 PM   #11
linda
Member
 
Registered: Apr 2001
Location: New Jersey
Distribution: Slackware
Posts: 222

Rep: Reputation: 30
Quote:
Originally posted by mikshaw
for mounting devices, edit /etc/fstab (as root).
add "user" to the options for each device you want users to mount.
example:
Code:
/dev/fd0             /mnt/floppy        auto       noauto,user,sync      0 0
How is this different from making my everyday user a member of the "disk" and "floppy" groups? I ask because of my thread http://www.linuxquestions.org/questi...hreadid=220972 about Groups, and because making myself a part of those groups did not let me access any files on my hard drives.

I guess someday this will all seem so easy?
 
Old 08-24-2004, 06:52 AM   #12
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
zwyrbla, the fstab file just defines what systems can be mounted where and who can do so. You still have to actually mount the filesystem via the mount cmd
A shortcut is just to run
mount -a
which mounts everything it can..... You can see what's currently mounted by looking at /etc/mtab (but do not try to edit this virtual file).
 
Old 08-24-2004, 10:27 AM   #13
PenguinPwrdBox
Member
 
Registered: Oct 2003
Location: /illinois/chicago
Distribution: Slackware/Gentoo/FC/RHEL
Posts: 568

Rep: Reputation: 30
Quote:
Originally posted by b0ng
There is another way to install software other than on the command line???
That's priceless...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alias will not stay crimsontide Debian 4 09-23-2005 11:54 PM
How do changes stay organized? MailleMan Linux - Newbie 2 07-05-2004 03:43 AM
Should I stay, or should I go? /home/kyle General 23 03-14-2004 02:36 PM
how to login and stay as root k1ng Linux - General 11 12-11-2003 02:08 PM
X won't stay up tlw1linux Mandriva 19 10-07-2003 04:50 PM


All times are GMT -5. The time now is 03:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration