I am logged in with imp user. And when I am trying to login via root user on terminal:
impuser@machine:~$ su - root
it gives:
setgid:Operation not permitted
any idea,How to resolve this issue?
Ubuntu only allows sudo
to increase privilege level, not su
(unlike other distros). To get a root
shell, try this:
sudo su
sudo bash
or whatever shell is your favorite
su
just fine (which is easily proved by seeing that sudo su
works), and does so like any other distro. What Ubuntu does not do is set a password for root by default. The reason sudo su
works is that su
is configured by default to not prompt for a password if it's run by root. That is also why this is the wrong way to do it - sudo
already runs as root, so su
is redundant (and undesireable for other reasons well-documented elsewhere). The "right" way to do this is, as @kervin noted, either sudo -i
or sudo -s
, optionally followed by the shell you want to run.
Feb 6, 2017 at 15:14
sudo -i
For an interactive root shell. This has the benefit of also processing the .login and .profile scripts.
sudo -s
Will also give you a root shell but it will not process the root login scripts.
If "impuser" is allowed to get root ( that means that he is not excluded from sudo rights in the /etc/sudoers
file ) Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below.
sudo su