sudocomm

thomasliju
thomasliju used Ask the Experts™
on
What this command means?


-bash-3.2$ sudo su - oracle
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Assistant Vice President\Network Manager
Commented:
you are executing a shell as user Oracle and after executing /etc/profile, .profile and .bashrc will end up in the Oracle home directory
Shahnawaz AhmedCloud Migration Engineer

Commented:
It means

taking sudo access for oracle user
Means priviliges of oracle user
Top Expert 2007

Commented:
su - oracle means switch user to oracle including running the .profile file to set env, etc.

If you run this command from a normal user account then you will be prompted for oracle user password

If you run the command as root then you are not prompted for oracle password

sudo let you run commands as root and in this case you will switch to oracle user without prompted for oracle password
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

David VanZandtOracle Database Administrator III

Commented:
Hi Thomas.  IMO pony10us comes the closest by calling it a shell, although that implies knowledge of what a shell does.  Likewise Mr. Ahmed and Mr. Farid, I think.  But once again wikipedia has it spot on.  

sudo is an (UNIX/LINUX) operating system that allows a user to execute a command with the security privileges of another user.  Moreover, the set of commands allowed are defined -- so the source user does NOT become the target (super)user.  Numerous Oracle docs on this, one being http://docs.oracle.com/cd/E37670_01/E41138/html/ch22s09.html.

Highlighting the rest of the syntax:

sudo su introduces the ability to switch user (su), in a non-interactive login shell.
sudo su - is one step further, executing the appropriate shell init scripts.  Upon exit, control passes back to the prior session.

Therefore, your answer is that the issuing user session temporarily creates a new interactive session as user oracle.

Can we be of further help?

dvz
Top Expert 2015

Commented:
sudo su - oracle means that somebody who rote it has no clue

it is equivalent to

sudo -u oracle -s

(and does not call "su" as sudo is superset of su's function)
Steven CarnahanAssistant Vice President\Network Manager

Commented:
Or?

sudo -u oracle -i

Author

Commented:
yes

.profile is correct.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial