HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: su - userid & su userid
Operating System - Linux
1831357
Members
2954
Online
110024
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 06:34 AM
04-25-2002 06:34 AM
su - userid & su userid
Hi,
In both situation of
user1#> su - user2 and
user1#> su user2
I have following questions:
1) if user1's the environment will be inherited in user2, including .profile, and all environment variables.
2) if user2's environment will be executed.
thanks in advance.
Roger
In both situation of
user1#> su - user2 and
user1#> su user2
I have following questions:
1) if user1's the environment will be inherited in user2, including .profile, and all environment variables.
2) if user2's environment will be executed.
thanks in advance.
Roger
none
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 07:01 AM
04-25-2002 07:01 AM
Re: su - userid & su userid
User#2 will inherit User1 environment. You can override this by using the -l switch. Example:
su -l
Will make user#2 run its environment shell.
su -l
Will make user#2 run its environment shell.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 12:59 PM
04-25-2002 12:59 PM
Re: su - userid & su userid
$ su - username
invokes username's login shell
$ su username
does not invoke login shell, just changes the effective UID of the user.
Quoting from man su
"Change the effective user id and group id to that of USER.
-, -l, --login
make the shell a login shell
-c, --commmand=COMMAND
pass a single COMMAND to the shell with -c
-f, --fast
pass -f to the shell (for csh or tcsh)
-m, --preserve-environment
do not reset environment variables
-p same as -m
-s, --shell=SHELL
run SHELL if /etc/shells allows it
--help display this help and exit
--version
output version information and exit
A mere - implies -l. If USER not given, assume root."
invokes username's login shell
$ su username
does not invoke login shell, just changes the effective UID of the user.
Quoting from man su
"Change the effective user id and group id to that of USER.
-, -l, --login
make the shell a login shell
-c, --commmand=COMMAND
pass a single COMMAND to the shell with -c
-f, --fast
pass -f to the shell (for csh or tcsh)
-m, --preserve-environment
do not reset environment variables
-p same as -m
-s, --shell=SHELL
run SHELL if /etc/shells allows it
--help display this help and exit
--version
output version information and exit
A mere - implies -l. If USER not given, assume root."
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP