sudocomm

What this command means?


-bash-3.2$ sudo su - oracle
thomaslijuAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
pony10usConnect With a Mentor 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
0
 
Shahnawaz AhmedTechnical Services SpecialistCommented:
It means

taking sudo access for oracle user
Means priviliges of oracle user
0
 
omarfaridCommented:
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
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
DavidSenior Oracle Database AdministratorCommented:
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
0
 
gheistCommented:
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)
0
 
pony10usCommented:
Or?

sudo -u oracle -i
0
 
thomaslijuAuthor Commented:
yes

.profile is correct.
0
All Courses

From novice to tech pro — start learning today.