LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trying to understand root login vs user login? (https://www.linuxquestions.org/questions/linux-newbie-8/trying-to-understand-root-login-vs-user-login-772035/)

UbrInKid 11-27-2009 11:22 PM

Trying to understand root login vs user login?
 
I am fairly new to linux (few months of so). I am trying to discover all the wonderous things linux has to offer. One thing in particular though that I am tying to figure out is why the difference between root and user login??

I am the only person that uses my computer so it didnt make sense for me to always login in as a user? As well it annoys me when I want to do various thing to have to type a "sudo" password all the time. But when I look to see how root login works I see all these cations about using root login.. why??? Whats the difference if I am the only user of my computer??

Thanks in advance for all the help!

Tinkster 11-27-2009 11:44 PM

The biggest difference is two-fold:

a) you protect yourself from yourself - if you do something
like "rm -rf *" and happen to be in your root directory ...
What happens if you're a "normal user"? What happens if you're
root?
Basically having to issue the extra password (do the extra step)
can be considered a friendly reminder that you may render your
machine useless.

b) it protects you from potential flaws in software you're using.
If you have a vulnerable browser, the person who wrote that nasty
site will not be able to simply turn your machine into a drone
in a bot-net.




Cheers,
Tink

indiajoe 11-27-2009 11:55 PM

Hi
GNU/Linux is a multiuser OS. It can have more than one user logined at a time from different loacations on network. And root is the GOD on that machine. If you are an expert there is nothing wrong in always working as root. Otherwise I suggest you to work as an ordinary user for the following reasons..
1) Linux gives complete freedom, as a result there is a chance that you will accidently corrupt the importent settings required for the working of the OS. [ Eg : "rm -rf /" if run as root will be catastophe]
So if you are working as an user, you will not be allowed to do them, unless you give the root password.
2) Say you accidently installed some malware (Very rare) , if you were running as root, then malware can completely distroy your machine. If you were running as an user, it wouldn't be powerfull to do anything in large scale.
3) And another important thing is that if you are always running as root and if there is any security hole in any of the programs you are running , you will be in a great danger.

And many more resons are there....
Most importantly "Enjoy GNU/Linux".... Yes it is the best thing Mankind has ever done for humanity.. for a better world..
-Cheers
indiajoe

Davno 11-28-2009 12:38 AM

For the reasons stated in the above comments, you should login in as user. But nothing stops you from configuring your OS and permissions on some directories to make life easier. Example: change permissions on wallpapers and icons directories, created a root file browser shortcut on your desktop. (I like Krusader for that). The beauty in Linux is that you can configure almost anything.

UbrInKid 11-28-2009 12:53 AM

So is there any easy solution to give my "user" all access that doesn't affect system vulnerable processes? If thats the right way to ask that.. My frustration is I find myself having to type passwords 30 times per session and also find I can not use some applications unless I log in as root?? I would like to roam my computer a bit easier and quicker but obviously do not want to ruin my computer because of a misunderstood command..

Tinkster 11-28-2009 12:58 AM

You could make that easier by giving yourself permission to run certain
apps passwordless; have a read of 'man sudoers'. But if you're sudoing
30 times per session your usage patters are pretty odd anyway - may I ask
what you're using sudo for? I seldomly have to do anything as root, and
linux has been my primary desktop OS for 8 years now.

UbrInKid 11-28-2009 01:16 AM

Quote:

Originally Posted by Tinkster (Post 3772057)
You could make that easier by giving yourself permission to run certain
apps passwordless; have a read of 'man sudoers'. But if you're sudoing
30 times per session your usage patters are pretty odd anyway - may I ask
what you're using sudo for? I seldomly have to do anything as root, and
linux has been my primary desktop OS for 8 years now.

Well currently I believe because I am downloading a lot of apps in order to get my system running the way I would like and doing operations I need to make my computer easy to use..

Also I do a lot of web design and connect a lot to my server and it seems that some function I request of my computer require root access?

rich_c 11-28-2009 02:44 AM

Check my blog entries. There's some info on using sudo to grant passwordless escalation of priviledges. It's intentionally NOT a step by step guide as I don't feel messing around at that level is suitable for someone who needs a step by step guide. Having said that, give it a read & do a bit of your own further reading & testing then go for it!

chrism01 11-29-2009 11:12 PM

Quote:

Also I do a lot of web design and connect a lot to my server and it seems that some function I request of my computer require root access?
such as?

manu-tm 11-29-2009 11:36 PM

you may too type one time "su" then "exit" instead of many "sudo" in a row, when necessary...

itsbrad212 11-29-2009 11:49 PM

you could use sudo :D

if your not in the sudoers file, run:

Code:

visudo
then find where it says:

Code:

root    ALL=(ALL)      ALL
and add *below* that line (dont write over the root line!):

Code:

nameofuser    ALL=(ALL)      ALL
this way, your user you entered for nameofuser will be given the permission to temporarily assume root status :D

smeezekitty 11-30-2009 12:11 AM

If it anoys you, just login as root!
Never had problem and i do it all da time.

rich_c 11-30-2009 03:43 AM

@ the two above posters. Sorry, but both posts are bad advice for someone who's still geting to grips with the risks/benefits. To the OP, read this and also my blog post about sudo. Configure sudoers to meet your needs as intelligently as possible and you'll have a convenient to use system that still retains some of the out of the box security provided by seperate root & user accounts.

evo2 11-30-2009 03:46 AM

Quote:

Originally Posted by smeezekitty (Post 3773977)
If it anoys you, just login as root!
Never had problem and i do it all da time.

DO NOT do this.

Evo2.

EricTRA 11-30-2009 03:49 AM

Quote:

Originally Posted by smeezekitty (Post 3773977)
If it anoys you, just login as root!
Never had problem and i do it all da time.

This, in my opinion without willing to offend anyone, is the WORST advice someone can give to someone starting out with Linux.

Kind regards,

Eric


All times are GMT -5. The time now is 12:13 AM.