3

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?

Nishu Tayal
  • 135
  • 1
  • 1
  • 6

3 Answers3

1

Ubuntu only allows sudo to increase privilege level, not su (unlike other distros). To get a root shell, try this:

sudo su
Linuxios
  • 343
  • 3
  • 14
  • The canonical way is to use `sudo bash` or whatever shell is your favorite – Wug Aug 20 '12 at 20:55
  • 1
    Ubuntu runs `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. – dannysauer Feb 06 '17 at 15:14
1
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.

kervin
  • 1,451
  • 1
  • 13
  • 13
-1

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
Mitch
  • 106,657
  • 24
  • 210
  • 268
tuxtimo
  • 99
  • 2