Results 1 to 3 of 3
This kind of annoys me.
When I'm working on my machine and I need to switch to the root user for a while, I type su and then enter the ...
- 01-22-2010 #1Just Joined!
- Join Date
- Jan 2010
- Posts
- 1
su creates multiple processes of su and bash
This kind of annoys me.
When I'm working on my machine and I need to switch to the root user for a while, I type su and then enter the password.
When I want to get back to my normal user, I type su simon and I'm back again.
What annoys me is that I don't get logged out from the previous user, but when I su back to root I'm in another instance of bash!
Eventually, my process list looks like this:
When I type exit, I step through every single one of those active bashes before I'm completely logged out of the system.debian:~# ps
PID TTY TIME CMD
2900 pts/0 00:00:00 su
2901 pts/0 00:00:00 bash
2931 pts/0 00:00:00 su
2932 pts/0 00:00:00 bash
2948 pts/0 00:00:00 su
2950 pts/0 00:00:00 bash
2948 pts/0 00:00:00 su
2950 pts/0 00:00:00 bash
2948 pts/0 00:00:00 su
2950 pts/0 00:00:00 bash
2951 pts/0 00:00:00 ps
This seem like a horrible waste of resources. How do I switch user and close the previous user at the same time without the computer dropping my SSH connection because I logged out?
I've tried su -l with no avail.
- 01-22-2010 #2Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
When I'm working on my machine and I need to switch to the root user for a while, I type su and then enter the password.
When I want to get back to my normal user, I type su simon and I'm back again.
You went Simon > root > Simon. Each su invokes a new session. It's the same as being in a web browser. You can go to Google > Yahoo > Google. OR you can go to Google > Yahoo > (BACK BUTTON) Google.
If you want Simon > root > (EXIT ROOT) > Simon then use exit to close root's session.
> su root (now root)
> exit (now simon)
- 01-22-2010 #3
When you want to stop being root hitting ctrl+d, end of file, is easier than typing exit.


Reply With Quote
