Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.