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.
How do I grant root access to a user without giving root/password?
You use sudo. It can let an ordinary user run commands with elevated privileges, and you can restrict users to just running ONE command (or a set of commands), if you'd like, to really lock things down. It has lots of other features too, and is pretty much a 'standard' way of doing this.
You use sudo. It can let an ordinary user run commands with elevated privileges, and you can restrict users to just running ONE command (or a set of commands), if you'd like, to really lock things down. It has lots of other features too, and is pretty much a 'standard' way of doing this.
Usually when this question is asked there is a lack of trust to the users that have to have administrative rights for their job. So giving them total root access with this line
Code:
username ALL=(ALL) ALL
is not a good idea, because the user will basically be root with this line and can do anything on the system. In this case it would be much less hassle to just give the user the root password instead.
To really give you the best advice it is necessary for us to know what exactly you are planning to allow to the user in question. I have seen it many times that people recommend sudo for a purpose when the Unix/Linux file permissions are a much better way to do the job.
Please explain more specific what you plan to do.
Usually when this question is asked there is a lack of trust to the users that have to have administrative rights for their job. So giving them total root access with this line
Code:
username ALL=(ALL) ALL
is not a good idea, because the user will basically be root with this line and can do anything on the system. In this case it would be much less hassle to just give the user the root password instead.
To really give you the best advice it is necessary for us to know what exactly you are planning to allow to the user in question. I have seen it many times that people recommend sudo for a purpose when the Unix/Linux file permissions are a much better way to do the job.
Please explain more specific what you plan to do.
+1 Tobi,
Read the man page link which I pasted ,it is helpful and do the google search you will get many examples .
Another best practice is to create alias of commands and assign it to group or user in /etc/sudoers.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.