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-28-2009 12:22 AM

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-28-2009 12:44 AM

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-28-2009 12:55 AM

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 01: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 01: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 01: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 02: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 03: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-30-2009 12:12 AM

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-30-2009 12:36 AM

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

itsbrad212 11-30-2009 12:49 AM

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 01: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 04: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 04: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 04: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

i92guboj 11-30-2009 05:37 AM

To add something to the advices above against running in god-mode all the time (which are wise, and you should really take into account), I will only add one thing: if you are seriously doing su or sudo 30 times per session, then you definitely are doing everything wrong. Once your system is set up, you shouldn't need to use administrator privileges unless you need to reconfigure some system core settings or unless you need to update or install something.

You should really revise your policies, stop and think a moment. Make a list of the things you are using root for, and then stop once again and explain why do you think you need root for each particular task.

Otherwise, completely ignore the advice of every *nix user, and suffer the consequences. But if you are going to do so, I'd rather be running a less restrictive OS, like Windows. You'll be happier.

Davno 11-30-2009 10:12 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.

If you do that, your system will be as secure as Windozzz.

Its normal to have to use (su) often on a new installation, once everything will be configure you won't need to be root often anymore.

catkin 11-30-2009 10:33 AM

Quote:

Originally Posted by evo2 (Post 3774146)
DO NOT do this.

Evo2.

I pretty much always have a root terminal open (and an unprivileged user terminal open). Looking back through root's command history this is for
  • Running backups
  • Mounting file systems not in fstab
  • Running commands in /sbin
  • Looking in some system info directories not otherwise readable
  • Searching directories not otherwise searchable
  • Changing system configuration files
  • Creating partitions and file systems
  • Installing software
  • Daemon control
When I first came back to *n*x I tried to adopt the new paradigm of using sudo for everything but got so frustrated at the extra keystrokes required for so little benefit. Perhaps if I was part of a sysadmin team administering a server farm it would be a good discipline but for a personal workstation with regular tested backups ... the risk-reduction/benefit ratio just didn't make sense; anyway, I figure I can screw things up just as much running commands via sudo as directly.


All times are GMT -5. The time now is 08:33 AM.