- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: root login vs. su (set user) to root--what are...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО09-25-2002 08:12 AM
тАО09-25-2002 08:12 AM
Can any shed some light on this for me? From what I found, there is a difference in root using /sbin and vs. /usr/bin and /usr/sbin.
Thanks, Terri Christensen.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2002 08:16 AM
тАО09-25-2002 08:16 AM
Solution# su - root
which actually takes and reads in root's .profile and may solve your problem.
Hope this helps
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2002 08:20 AM
тАО09-25-2002 08:20 AM
Re: root login vs. su (set user) to root--what are the differences?
When you want to su as root and wants to use profile of root then you could try as
su - root ( There is space between - and root)
Goodluck
-USA..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2002 08:20 AM
тАО09-25-2002 08:20 AM
Re: root login vs. su (set user) to root--what are the differences?
Try this. I believe you have root permissions on the script and are not doing a su - in the script just before the command.
If you are doing a su - in the script then do this.
su root instead of su -
or the alternate thing as
su - instead of su
(if it is already the first case in your script)
Otherwise, put your script in debug mode and check where it stops.
#!/usr/bin/sh -x
instead of #!/usr/bin/sh (the above one will give error or stop/pause at a place where the command is unable to execute)
Please let us know of more issues after this.
Regards,
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2002 08:22 AM
тАО09-25-2002 08:22 AM
Re: root login vs. su (set user) to root--what are the differences?
Thanks for the quick response. Terri Christensen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2002 08:34 AM
тАО09-25-2002 08:34 AM
Re: root login vs. su (set user) to root--what are the differences?
There can be many differences, depending on how you "su". The closest to a true login is a "su -". If you use "su - root" instead of just "su root" (in either case, "root" can be omitted), a true login is simulated, by telling the shell to behave like a login shell (i.e. sourcing the system and user profile files), and clearing the previous environment. But there still are the following differences:
- The user's tty doesn't change and still belongs to the logged in user
- The system logins files (/etc/utmp* and /var/adm/wtmp*) are not updated. This is normal, since it's just a user change and not a system login (entrance into the system). There's already an entry for the current login, think twice before tampering with those files...
As far as I know, those are the only differences. You can use the command "logname" to determine the login user name, which doesn't change across "su"s.
HTH!
Regards,
Olivier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2002 09:45 AM
тАО09-25-2002 09:45 AM
Re: root login vs. su (set user) to root--what are the differences?
I expect you have your answer: use "su -" instead of simply "su".
Now for the soapbox: don't give out unrestriced root access to anyone outside the UNIX system administration group.
Try to set up the app where superuser priviledges are not needed. If there's no way to get by without the user running something as superuser, you should use restricted SAM or sudo.
You can find a lot of info on these tools by searching the forums.
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2002 07:38 AM
тАО10-09-2002 07:38 AM
Re: root login vs. su (set user) to root--what are the differences?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-09-2002 12:44 PM
тАО10-09-2002 12:44 PM
Re: root login vs. su (set user) to root--what are the differences?
maybe I am tto late, but there is an important difference between "su -" and "login":
some process attributes are NOT reset due to "su -", like your "logname", so you are still logged in as somebody else (not "root"), and this piece of information is e.g. used for your eMail address - don't expect mail to be sent to your "root" account, but to the one you logged in with!
FWIW,
Wodisch