HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sudo user entry in syslog...
Operating System - HP-UX
1834272
Members
70009
Online
110066
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
Go to solution
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
05-29-2007 05:24 PM
05-29-2007 05:24 PM
Hi guys,
I would like to know about my sudo entry in syslog..i.e. whenver i log in with sudo su - the entry recorded is as follows:->
May 30 10:39:06 ge1 sudo: tejas : TTY=pts/8 ; PWD=/home/xyz ; USER=root ; COMMAND=/usr/bin/su -
May 30 10:39:06 ge1 su: + 8 test-root
where test is another ordinary user in my system...
Why am i getting this entry of test1-root and not xyz-root...???
But sometimes randomly i do get xyz-root in my syslog.
I would like to know about my sudo entry in syslog..i.e. whenver i log in with sudo su - the entry recorded is as follows:->
May 30 10:39:06 ge1 sudo: tejas : TTY=pts/8 ; PWD=/home/xyz ; USER=root ; COMMAND=/usr/bin/su -
May 30 10:39:06 ge1 su: + 8 test-root
where test is another ordinary user in my system...
Why am i getting this entry of test1-root and not xyz-root...???
But sometimes randomly i do get xyz-root in my syslog.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2007 05:32 PM
05-29-2007 05:32 PM
Re: sudo user entry in syslog...
hi guys,
the entry log ..its actually ...
May 30 10:39:06 ge1 sudo: xyz : TTY=pts/8 ; PWD=/home/xyz ; USER=root ; COMMAND=/usr/bin/su -
May 30 10:39:06 ge1 su: + 8 test-root...
the entry log ..its actually ...
May 30 10:39:06 ge1 sudo: xyz : TTY=pts/8 ; PWD=/home/xyz ; USER=root ; COMMAND=/usr/bin/su -
May 30 10:39:06 ge1 su: + 8 test-root...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2007 08:04 PM
05-29-2007 08:04 PM
Solution
"sudo su -" is often used, but a slightly silly way to do things.
When you use it that way, the "sudo" command allows you to execute the command "su -" using the identity of root.
Then, the "su -" command makes you assume the identity and environment of root. Because you already have the identity of root (thanks to sudo) it won't ask for a password. You're effectively using "su -" to change from root to root!
The second syslog line looks a bit strange.
Do you happen to have a second copy of UID 0 with the username "test"? To check, run:
grep "^[^:]*:[^:]*:0:" /etc/passwd
It should return exactly one line, not two or more.
Or maybe your utmp file is corrupted because you've stopped some sessions with kill -9?
A reboot will regenerate your utmp file. You can also clear the utmp file manually, but you will lose the information about currently logged-in users, so you should do that only when you're the only person logged in.
A neater way to do the same thing as "sudo su -" would be "sudo -H -i". The -H option means to use root's home directory, so the environment settings that might be in root's .profile will take effect. The -i option means the same as the "-" in "su -", so you'll get the complete environment of the root user.
If you need to assume the identity of some other user, just use "sudo -u -H -i" instead of "sudo su - "
This way causes you to get just one line of syslog about the operation (from sudo), and it will say exactly what happened, i.e "xyz changed into someuser" instead of first saying "sudo: xyz became root" then "su: root became someuser".
MK
When you use it that way, the "sudo" command allows you to execute the command "su -" using the identity of root.
Then, the "su -" command makes you assume the identity and environment of root. Because you already have the identity of root (thanks to sudo) it won't ask for a password. You're effectively using "su -" to change from root to root!
The second syslog line looks a bit strange.
Do you happen to have a second copy of UID 0 with the username "test"? To check, run:
grep "^[^:]*:[^:]*:0:" /etc/passwd
It should return exactly one line, not two or more.
Or maybe your utmp file is corrupted because you've stopped some sessions with kill -9?
A reboot will regenerate your utmp file. You can also clear the utmp file manually, but you will lose the information about currently logged-in users, so you should do that only when you're the only person logged in.
A neater way to do the same thing as "sudo su -" would be "sudo -H -i". The -H option means to use root's home directory, so the environment settings that might be in root's .profile will take effect. The -i option means the same as the "-" in "su -", so you'll get the complete environment of the root user.
If you need to assume the identity of some other user, just use "sudo -u
This way causes you to get just one line of syslog about the operation (from sudo), and it will say exactly what happened, i.e "xyz changed into someuser" instead of first saying "sudo: xyz became root" then "su: root became someuser".
MK
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2007 10:53 PM
05-29-2007 10:53 PM
Re: sudo user entry in syslog...
Hi,
Matti may be on the right lines, but I would suggest checking your /etc/passwd file for a user called 'test' with the same uid as 'xyz', and also the sudoers file for the same.
Andrew
Matti may be on the right lines, but I would suggest checking your /etc/passwd file for a user called 'test' with the same uid as 'xyz', and also the sudoers file for the same.
Andrew
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