We help IT Professionals succeed at work.

Granting root permissions to a user (in Debian Jessie)

Soumen Roy
Soumen Roy asked
on
789 Views
Last Modified: 2017-04-16
Hello,

I have created a new user in my computer running Debian Jessie. Now, I some utilities that require root permissions.

How do I provide all superuser(root) permissions to this new user?
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2007

Commented:
Hi,

You can use sudo. Please see below link for howto and examples.
CERTIFIED EXPERT
Top Expert 2007

Commented:
Below kink can guide you how to use and with examples:
https://www.sudo.ws/
Soumen RoySenior Manager

Author

Commented:
I don't want to be using the sudo command all the time. I want superuser commands to run without the use of sudo.
CERTIFIED EXPERT
Top Expert 2007
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
ANUPKUMAR NAIRManager IT Infrastructure
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Soumen RoySenior Manager

Author

Commented:
Okay, thank you. How to change the user ID to 0?
Soumen RoySenior Manager

Author

Commented:
Okay, thank you. How to change the user ID to 0?
ANUPKUMAR NAIRManager IT Infrastructure

Commented:
usermod -u 0 -o username
ANUPKUMAR NAIRManager IT Infrastructure

Commented:
CERTIFIED EXPERT
Top Expert 2007

Commented:
Please note that this is not the best way of doing it.
arnoldEE Topic Advisor, IT Consultant
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
The whole point of using sudo, it is not you who will be using sudo, but the user you created
sudo command
which is the optimal way to grant a user elevated to run some commands as root without having them have full access to the commands.

IMHO, adding the user to other/root group or setting their UID to 0 is a poor suggestion and a poorer solution.

What commands do you want this user to be able to run?

The whole idea of setting up a secondary user is so that you would not be using root to login.
Using a new username that has the same root level rights means you only symbolically trying to follow best practices while effectively not following them...
CERTIFIED EXPERT
Top Expert 2007

Commented:
I agree with arnold. sudo is the proper way.
CERTIFIED EXPERT

Commented:
Add the user to the sudo group.  It could be the wheel group in older versions

sudo adduser <username> sudo
or
usermod -aG sudo username


He can then just run
sudo -i
Soumen RoySenior Manager

Author

Commented:
Sorry for the late reply.

I had some confusion about how it all works. I have a few scripts that need to autorun. I created those scripts from this new user and had to run them using sudo. But the scripts needed to autorun during boot. I was confused about the part that while the system loads, it actually boots as root. I was considering I had to give some kind of root permission to this new user to achieve this autorun process. However, then I added the scripts to the /etc/rc.local file, and adding them to this file made them start at boot by default, so it was not necessary to provide all root permissions to this user after all.

 Thank you for your suggestions.

However, root permissions might be necessary if I want to put a user as the admin of the system. And also, the raspbian jessie I used, always asked for a password to access the root user using "sudo su", but I had not actually set a root password. So this got me thinking to not access the root user at all and create a different user with all the root permissions available to that user. Eventually I solved that too, I used sudo -i to and that got me into the root user and then I changed the password.
arnoldEE Topic Advisor, IT Consultant
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Sudo su is redundant, sudo -s sudo -i sudo bash, the password prompt is part of the sudoers config and the password is that of the user executing sudo.

Not sure why, or whose password you intended to change and the effect of what you have done. From the last comment, you may have changed the root's account password.
CERTIFIED EXPERT

Commented:
sudo does not use the root password and logs the access differently than if you connect to root directly.
Natty GregIn Theory (IT)
CERTIFIED EXPERT

Commented:
Its not necessary to give root access, the platform is secured for a reason, that is why elevated commands are used instead so I'd grant permission for the second user to sudo. If the second user is compromised and has root access you can kiss the network goodbye

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.