Solved

sudocomm

Posted on 2014-02-25
7
113 Views
Last Modified: 2014-10-15
What this command means?


-bash-3.2$ sudo su - oracle
0
Comment
Question by:thomasliju
7 Comments
 
LVL 26

Accepted Solution

by:
pony10us earned 500 total points
ID: 39885902
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
 
LVL 7

Expert Comment

by:Shahnawaz Ahmed
ID: 39885917
It means

taking sudo access for oracle user
Means priviliges of oracle user
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 39885944
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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 23

Expert Comment

by:David
ID: 39888735
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
 
LVL 62

Expert Comment

by:gheist
ID: 39898820
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
 
LVL 26

Expert Comment

by:pony10us
ID: 39900740
Or?

sudo -u oracle -i
0
 

Author Closing Comment

by:thomasliju
ID: 40383697
yes

.profile is correct.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question