Solved

HP-UX

Posted on 2013-02-01
6
226 Views
Last Modified: 2013-02-06
Hello,
This is my problem; when I use sudo su - xxx, then when I exit,  I end up at the xxx home directory.  How could I exit sudo and remain at the directory I am at?
0
Comment
Question by:chima
6 Comments
 
LVL 31

Expert Comment

by:farzanj
ID: 38845647
sudo su xxx

Without hyphen
0
 
LVL 31

Expert Comment

by:farzanj
ID: 38845648
Hyphen is meant to also get the home directory and environment of the new user.  If you skip that, you are in your own directory and your own environment.
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 250 total points
ID: 38845653
"su -" starts a new login shell, and after exiting from this shell you're back where you came from.
This behaviour cannot be changed.
It doesn't matter whether su - was started via sudo or directly.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 40

Accepted Solution

by:
omarfarid earned 250 total points
ID: 38845849
when you su to another user and exit you go back to the same dir you where in, it can't be the same dir of that user or last one before you exit.

check with command id what is the current user you use
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 38846801
A bit late but how about a good old "man su"for starters? It's all there :D
0
 

Author Closing Comment

by:chima
ID: 38861872
gerwinjansen, I pay a membership fee!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

820 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