SlackwareThis Forum is for the discussion of Slackware Linux.
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.
I see in the web that there are several ways to set up /etc/sudoers to allow myself to execute commands as if I were root.
1) add myself to wheel group and setup wheel to ALL by removing the # from that linel
2) add myself as xxxx ALL=(ALL) ALL beneath root ALL=(ALL) ALL.
Can I do it this way so as not to have to respond with password:
xxxx ALL=(ALL) nopasswd:ALL
3) add myself for specific commands in /etc/sudoers
4) or make myself a member of sudo group.
Obviously, #3 is the safest but for myself wouldn't #2 be acceptable. Since this is a single user system I am presuming the nopasswd mode should be OK.
Becoming a member of sudo or wheel group does NOT seem to be the most secure.
What if I were to have a copy of sudoers which had no users and copied that to /etc/sudoers when on the internet and another to copy to sudoers when off the web. If these 2 files were made very secure would this be considered a secure means?
Do I have the approaches correct as I seen several to employ and after an extremely long time in computer science this is the second time I have had to fiddled with sudo.
While the second option is a viable option for a single user system, the NOPASSWD option is not. This is basically the same as logging in as root which is a bad idea if your system is exposed to the net.
I personally use su for administering the system, with a few selected commands that I use very often, setup with sudo without password.
I normally do your 2nd method but I leave nopasswd option off. If you are working in command prompt and once you issue the command "sudo <yourcommands>" you won't have to keep reentering your password over and over. Its a little safer and I would go with that route.
I think that is simple and securely to use the 3th variant. But I don't have a big set of the commands, mount and umount only... For administrative tasks I use 'su -' and 'su -c "command -arguments"'
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.