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.
You should look into the commands you want to allow prayag to have and then limit them to that because their are several other methods that this user can use to get full root. But as it goes the difference between giving a user full sudo privilages is not far off from full root, they just need to mess about with their $PATHs and put sudo infront of everything...
Their is also "sudo /bin/sh" or "sudo /bin/bash" what would have similar effects to "sudo su -" or "sudo passwd root" to reset the root password. I would look more into actually setting proper sudo privilages and limiting what commands the user has access to.
Only if you can list all the cmds you want to allow and you are certain none of them allows a shell escape. Harder than you think.
sudo enables specified cmds, there's no way to specify disallowing cmds. It just disallows any cmds not listed (ie that aren't specifically listed/enabled).
Even if you limited it down to all the basic methods, if your giving them sudo, you are still giving them the ability to install a shell and then run it as root... Also even if you remove all but root shells, giving them sudo to everything else means they can do anything root can do via the use as sudo and view everything root can see. It's pointless to give them EVERYTHING else but direct root logins since they can still do whatever it is you don't want them do via sudo. Review what commands they actually need and then limit the sudoers file to just those commands and only those commands.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.