I am using the following command in Oracle Exadata:

     sudo su - odiadmin

As sudo prompts for my own password, I am wondering if I upgrade myself to super user or do I switch to superuser 'odiadmin'. Also, is odiadmin a superuser group or just another user.

Can anyone shed some light?

migrated from stackoverflow.com Feb 21 '14 at 16:42

This question came from our site for professional and enthusiast programmers.


sudo runs a given command as superuser (i.e. root). The command it runs is su - odiadmin, which substitutes the user odiadmin - so that is another user, not a group, and it itself is not a superuser in the sense that root is.

The - flag to su makes it a login shell, and you aren't running a specific command as that user, so you're dropped into a new shell as that user - essentially the same as if you'd started a new session as that user via telnet or ssh.

The effect is also the same as if you'd just done su - odiadmin, but if you did that you'd need to know the password for that account. Using sudo means you only have to know your own password, which makes life simpler for you, but requires the sudo service to be configured to allow you to issue the su command, so there are potentially security implications if that isn't done properly.

So... you upgrade yourself to superuser (root) but only to switch to the non-superuser odiadmin account. When you're in the shell as odiadmin you do not have any root privileges, or any of your original account's privileges For example, you can only see files that are owned by odiamdin, or in groups that odiadmin is also in, or that are world-readable. You probably can't see files in your own home directory, if that has sensible permissions like 700. And you can't run any root-only executables like useradd. You are not root after you run that command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy