|
|
Views
Edit history
changed:
-
Run a shell as a substitute user
How do I execute a command as root, without logging out?
The *su*, or substute user command allows you to become another user from your current shell. To become root:::
su
# whoami
root
#
What is the difference between "su" and "su -"?
"su" maintains your current environment, while "su -" acts like a login shell. Use "su -" if you want to act like you just opened up a new terminal and logged in as root.
I don't want to be root.
I have joe's password, and I want to log in as him.
Easy, [Su] can substitute as any user, not just root.::
[[user@host]$ su joe
Password: [[joe@host]$
Same rules apply about the dash: "su - joe"
That's really neat. I just want to run a command, instead of logging in.
[Su] anticipated that: use the -c option::
[[user@host]$ su -c whoami
Password:
root
[[user@host]$
Is [Su] the only command that can do this?
For another way, look at the [sudo] command.
|
|
«
|
January
2009
|
»
|
| Su |
Mo |
Tu |
We |
Th |
Fr |
Sa |
|
|
|
|
1 |
2 |
3 |
| 4 |
5 |
6 |
7 |
8
|
9 |
10
|
| 11 |
12 |
13 |
14 |
15 |
16 |
17 |
| 18 |
19 |
20 |
21 |
22 |
23 |
24 |
| 25 |
26 |
27 |
28
|
29
|
30 |
31 |
-
Installfest January 10, 2009
National City Adult Education Center: 517 Mile of Cars Way; National City, CA 91950,
2009-01-10
-
Open Source Conference, January 28,29 2009
Ramada Inn & Conference Center
5550 Kearny Mesa Rd.
San Diego, CA 92111,
2009-01-28
-
General Meeting, February 12, 2009
San Diego County Office of Education 6401 Linda Vista Rd Rooms 401 & 401,
2009-02-12
|