Solved

HP-UX

Posted on 2013-02-01
6
224 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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 37

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

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

Question has a verified solution.

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

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…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

803 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