LinuxQuestions.org
Review your favorite Linux distribution.
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 07-18-2004, 12:24 AM   #1
couvier
LQ Newbie
 
Registered: Jun 2004
Posts: 15

Rep: Reputation: 0
Why not log into linux as root?


I've read a few things that say dont log into linux as root, instead always log into linux as a user then if you need to do root commnds use the:

su -c "command"

Now, i dont understand why not just log into as root and do your stuff then logout, why do so many people say this?

One thing i read is that logging in and using Linux as root operator isn't a good idea because it defeats the entire concept of file permissions. What does this mean?

Hopefully somebody can shed some light on this for me.
 
Old 07-18-2004, 12:51 AM   #2
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
You can login as root at a console but do not run X Window Server. Logging in as root can give away your password, so admins sets up users who can login as sudo. Using sudo is the samething as su but it makes it secure because no password is entered. Being as root can be very risky. As root can trash the whole entire system by just running "rm -R /". If you run that command as a normal user, it will give you permission denied.

BTW, I thought this is common sense because everybody has crashed their computer in Windows 3.1, Win95, and Win98.
 
Old 07-18-2004, 02:27 AM   #3
BobSmith401
LQ Newbie
 
Registered: Jul 2004
Posts: 5

Rep: Reputation: 0
Of butter and blades

Quote:
Originally posted by couvier
...defeats the entire concept of file permissions. What does this mean?

Hopefully somebody can shed some light on this for me. [/B]
Ok. I'll take a stab at this one. As Electro pointed out Windows (particularly the DOS-based W9x/me versions) clearly illustrates the dangers of running as root, but the connection isn't intuitive.

The fact that you're asking about file permission fundamentals leads me to believe that exploring this might be productive. (No offense)

Basically, you want to avoid running as root/Administrator/whatever because those accounts can literally do anything. This is very convenient, since the OS never tells you "no" - you are the god of your own little universe. On the other hand, it's very dangerous, since any program you run is god too, and can do anything it wants. Not to get too Biblical, but think Lucifer here.

Analogizing, running day-to-day activities as root is like using a surgical scalpel to butter your bread - No matter how frozen that butter is, you will get your bread buttered. However, since butter isn't usually frozen your habit of using scalpels means you'll eventually slice off a finger - count on it.

Hope this helped... If not, I'll babble on.
Bob
 
Old 07-18-2004, 08:53 AM   #4
vectordrake
Senior Member
 
Registered: Nov 2003
Location: NB,Canada
Distribution: Something alpha or beta, binary or source...
Posts: 2,280
Blog Entries: 4

Rep: Reputation: 47
I think you make a valid point. Sometimes its nice to test something as root. I don't see a problemwith logging in as root and back out again. I've done it myself, but not often. There is, of course the reason one logs in as user and then "su's" to root is because they are still just a regular user, bot with temporary root powers. You can exit and you're not root anymore. This layerd approach is a bit more secure.

I do it because I'm lazy. It takes less time to remain as a user and use "su". There are vry few opportunities where you'd need to check something in a GUI as root, so using "su" is easier and faster with less work.
 
  


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
Cant only log in as root after user log-in. ADJenkins Linux - General 2 11-17-2004 05:18 PM
Log Out root Then Log In As Other User xtremcoder Linux - General 4 10-05-2004 12:01 AM
Log on as Root, or switch to Root, in MDK 9.1 - KDE 3.1.0 snorky Mandriva 3 09-01-2003 01:07 PM
Linux Root User Log In Problem winmelnx Linux - General 5 02-28-2003 12:18 AM
Linux root user log in problem winmelnx Linux - General 0 02-23-2003 02:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration