Solved

HP-UX

Posted on 2013-02-01
6
223 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

895 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now