LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 06-13-2011, 05:24 PM   #1
cristi92b
Member
 
Registered: May 2011
Posts: 94

Rep: Reputation: Disabled
should I use the root account?


It is just an option or it is like a rule not to use the root account?

edit:
Thank you! So I guess using root account with GUI is no option.

Last edited by cristi92b; 06-13-2011 at 05:40 PM.
 
Old 06-13-2011, 05:36 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
A rule of thumb is: use the root as little as possible and only when absolutely necessary. Always make sure you understand a command before you run it as root.
 
Old 06-13-2011, 05:50 PM   #3
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Quote:
Thank you! So I guess using root account with GUI is no option
There shouldn't be such a need. I might be wrong but I haven't heard of a situation where you HAVE to log in to GUI as root. All the system-wide admin tasks can be accomplished with su/sudo.
 
Old 06-13-2011, 05:53 PM   #4
cristi92b
Member
 
Registered: May 2011
Posts: 94

Original Poster
Rep: Reputation: Disabled
Thank you! I'll mark this thread as solved.
 
Old 06-13-2011, 05:56 PM   #5
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
I agree with sycamorex, use the root account when necessary, no more, no less. You need to learn to use it and use it properly as it is absolutely necessary to perform certain tasks. It shouldn't, however, be used for every day stuff like a normal user account is. There are a couple of reasons for this. One, it is all too easy to make a mistake that is irrecoverable and wipes out your entire system. For example, if you want to delete a directory you can use the rm -rf command. If you accidentally enter this command from the wrong location or with the wrong parameters, you can erase your system binaries. If this happens and you are operating as a normal user, no harm no foul as the command won't execute. As root, though, you won't get a warning, you won't be asked if your sure, it will just happen. Second, if you are running certain application as root, such as a web browser and that browser becomes compromised the attacker will be executing with the privileges with which the browser is running: in this case root. The consequences of this would be disastrous and completely preventable.
 
Old 06-14-2011, 03:29 AM   #6
Knightron
Senior Member
 
Registered: Jan 2011
Location: Australia
Distribution: openSUSE
Posts: 1,465
Blog Entries: 6

Rep: Reputation: 200Reputation: 200Reputation: 200
Quote:
Originally Posted by Noway2 View Post
For example, if you want to delete a directory you can use the rm -rf command. If you accidentally enter this command from the wrong location or with the wrong parameters, you can erase your system binaries. If this happens and you are operating as a normal user, no harm no foul as the command won't execute.
Hi i know this thread is solved, but i'd like to ask an additional question relevant to this. In reference to the post above, i was just wondering, if you've done a "su" and then launch a decremental command like the one above, will it fail or still execute?
 
Old 06-14-2011, 03:33 AM   #7
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
'su' will grant you root privileges so rm -rf would be executed.
 
Old 06-14-2011, 04:37 AM   #8
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
To follow up on your line of thinking, there is the sudo command; sudo - super user do. It is often times and excellent alternative to running as the root user. If what you require is to run a command or two, sudo can be an easier, as well as safer approach. Some distributions like Ubuntu lock the root user account and rely on using sudo. To use it, you prefix the privileged command with sudo and you will be prompted for your password. In this case, it is the USER password. In order to enable it, you need to add the user to the sudoers list as well as specify the commands that are allowed. You should read the man files or other online documentation to learn more about how this works.

One other thing I should mention, if you run an SSH server, it is considered to be a very bad security risk to allow SSH capability directly into root. Instead you should always require SSH via a user account and then elevation to root. Amongst other things, root is about the most commonly attempted brute force attack on an ssh server. By turning this capability off, you will eliminate one of the biggest threats to an SSH server.
 
  


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
how can i run a java program with root privilages from a non-root account? joyjjs Linux - Software 1 08-04-2009 12:14 AM
root account or user account arodlinux SUSE / openSUSE 3 12-23-2008 08:59 PM
Why is my common account can't open Terminal in XFCE4 but root account? notsay Slackware 4 08-18-2007 11:29 PM
Identifying non-administrators w/ root privilege/ Multiple root account in use wjeanpaul Linux - Security 4 05-19-2006 08:55 PM
is it legitimate and allowed and can be done to make another user account set uid and gid to null 0 to make another root account with different name and possibly not damage the debian system creating and using that new account BenJoBoy Linux - Newbie 12 01-29-2006 10:02 AM

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

All times are GMT -5. The time now is 06: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
Open Source Consulting | Domain Registration