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.
Yea, that's easy...in the sudoers file they already gave some examples of usage. So anyhow, lets say your username is "johnnie". You would add this line:
johnnie ALL=(ALL) ALL
If you noticed, root has that exact same line. That's it...you're done.
Of course you can't run root commands by just typing in the command. You have to put "sudo" before the command.
can i have privilages that allow me to do more things other than run commands? for example view directories or change system settings without using terminal?
If you search the board, it's been covered reluctantly a few times. It's really really really not a good idea. You'll be logging in as root everyday in such a situation, and then there goes half your safety net! Unless you are an uber-guru, which even then you would realize how bad it is and not do it, you shouldn't give a user all of root's priv's. Using the sudoers file is the closest I'd think one should come to doing so.
And as a side note to my above statement: If you were that guru who decided to, you'd by that time know how
There's nothing at all wrong with granting the "normal user" that you (the actual owner and admin of the machine) "effective root" every time they log in by using the sudoers line I posted above. The only slight difference in security is that if someone can pop into your normal user's account, they can root your box. But if that's happening, you have other more serious problems already than having sudo set up the way it was. I actually highly recommend using sudo the way I described above. It makes doing admin tasks rather easy without making it so braindead as to not know what you are doing.
Note: this is the only way I advocate giving "effective root" (passwordless even) to any normal user. Setting your UID to 0 or something stupid like that, however, is ... just that, stupid.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.