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?

1
  • You're using ubuntu, so you want sudo, not su.
    – Wug
    Aug 20, 2012 at 13:00

3 Answers 3

1

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

sudo su
2
  • The canonical way is to use sudo bash or whatever shell is your favorite
    – Wug
    Aug 20, 2012 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 6, 2017 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.

-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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .