Add NOPASSWD in /etc/sudoers to only some specific commands
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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.
Are there any risks for letting the beyond commands to be used with no password?
Sorry, I'm not really sure what the security implications would be doing this via sudo... what I guess I would do is create one liner scripts to do each these things and make them owned by root and change the permissions to 4755 (setuid) so they run as root even if you run it from an ordinary user account.
Some recommendations how to do it from scratch please?
If it is not possible or it is a big risk(like having the password stored somewhere in plain text) to never write the password for every each command, maybe at least it is possible to write it only one after boot. Without to have to write it again until the next reboot, or after system sleeps or hibernates for example.
Some recommendations how to do it from scratch please?
If it is not possible or it is a big risk(like having the password stored somewhere in plain text) to never write the password for every each command, maybe at least it is possible to write it only one after boot. Without to have to write it again until the next reboot, or after system sleeps or hibernates for example.
## Same thing without a password
%wheel ALL=(ALL) NOPASSWD: ALL
can be
Code:
## Same thing without a password
%sudo ALL=(ALL) NOPASSWD: ALL
depending on what group you use. You will still have to use sudo - it just removes the need to add the password. that is what I do
This could be useful too, but it seems to open up your system more than my way, which limits it to one command with specified options, so should be safer. Plus you don't have to type sudo. It's up to you... in UNIX there's almost always several ways to get something done
This could be useful too, but it seems to open up your system more than my way, which limits it to one command with specified options, so should be safer. Plus you don't have to type sudo. It's up to you... in UNIX there's almost always several ways to get something done
SetUID for scripts has been disallowed in Unix/Linux for a long, long time due to insurmountable security issues.
As far as I know the executable is not the script, but the interpreter (bash itself). Therefore using setuid on script is simply meaningless. You ought to use it on the binary.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.