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.
After adding what I thought were the correct entries in /etc/sudoers so I'd be able to run commands without needing to sudo them, I keep having to. My sudoers file entries look like this:
Code:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
user_me ALL=(ALL) ALL
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
user_me ALL=(ALL) ALL
## Same thing without a password
%wheel ALL=(ALL) NOPASSWD: ALL
user_me ALL=(ALL) NOPASSWD: ALL
I have also confirmed that I'm a member of the wheel group in /etc/group:
Code:
wheel:x:10:root,user_me
And yet, I still have to sudo to do pretty much anything.
I'd really rather not be root for anything on the server, so I thought that adding myself to the wheel group would allow me to run things as root without actually being root, but maybe I misunderstand?
Just in case you forgot to re-edit psswd and sudoer files: If you don't need it anymore you may remove your membership to GID "wheels", your entry to sudoer ALL is enough.
user_me ALL=(ALL) NOPASSWD: ALL
%wheel ALL=(ALL) ALL
The other entries might just be confusing things. The leading "%" means "group" (I'm pretty sure about that). So, what this does is set you to not needing a password and all users in the wheel group will need a password. You can set them to no password also, but I would not recommend it. Actually, I don't recommend you not needing a password either, but there are cases where that could be useful. General rule for me is to limit "NOPASSWD" to as few people as possible, if it is needed at all.
I went ahead and tried something. I've removed myself totally from sudoers. But, it seems that being a member of the wheel group covers me for being able to sudo all commands by virtue of this line in sudoers? In other words, being a member of wheel makes it unnecessary for me to be specified at all in sudoers.
Code:
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
That should allow all users in the wheel group to run programs with sudo, and they will need a password. And, since you are a member of wheel, this will work. So, the short answer, is yes. Personally, I would go with the single entry for just you. But, that's up to you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.