-1

I added a user to the root group, but the user is still not able to perform operations that require root's permissions. What is the problem?

Zanna
  • 70,465
John Ronald
  • 1,816
  • 3
  • 15
  • 29

2 Answers2

3

Root login is disabled on Ubuntu. Adding user to root group will only affect permissions of files what have root group, for example edit some config files without sudo. Use sudo before a command to run that command as root, or sudo -i to get a root shell.

Zanna
  • 70,465
LeonidMew
  • 2,734
  • 1
  • 21
  • 38
2

root login is disabled on Ubuntu. Adding user to the root group will only allow access to files that have root group, for example some config files. Being in the root group does NOT give any special privs.

To grant a user access to sudo, read man sudoers and add them to the sudo group.

adduser <username> sudo

The, once the other user logs out&in, or does a newgrp sudo, the other user will be able to preface his/her command with sudo to run as root, e.g. sudo wc -l /etc/shadow.

waltinator
  • 36,399
  • The command adduser as given returns an error message. Perhaps you meant addgroup instead? Also, you largely duplicated what LeonidMew already answered; you really need to add more content to your answer to superseded his answer. – doneal24 Feb 12 '19 at 18:48
  • @DougO'Neal What exactly did you type? Did you replace <username> with the Name of the User? Did you pass exactly two parameters to adduser? – waltinator Feb 12 '19 at 18:55
  • adduser <username> sudo where is the name of an existing user. – doneal24 Feb 12 '19 at 19:03