- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- odd who am i issue
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
Forums
Discussions
Discussions
Discussions
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
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
03-16-2009 08:30 AM
03-16-2009 08:30 AM
odd who am i issue
$ who am i
$ who
oracle pts/0 Mar 16 07:40
root pts/1 Mar 16 10:23
$ w
11:27am up 5 days, 20 mins, 2 users, load average: 0.09, 0.16, 0.21
User tty login@ idle JCPU PCPU what
oracle pts/0 7:40am 3:38 -ksh
root pts/1 10:23am -sh
$ pwd
/home/rleon
$
correct:
$ who am i
rleon pts/tg Mar 16 11:28
$ who
rleon pts/tg Mar 16 11:28
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2009 08:43 AM
03-16-2009 08:43 AM
Re: odd who am i issue
what's about 'whoami' ?
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2009 08:44 AM
03-16-2009 08:44 AM
Re: odd who am i issue
$ whoami
rleon
$ who
oracle pts/0 Mar 16 07:40
root pts/1 Mar 16 10:23
$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2009 08:50 AM
03-16-2009 08:50 AM
Re: odd who am i issue
You had 'su'ed users. Compare:
# whoami
# who am i
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2009 09:03 AM
03-16-2009 09:03 AM
Re: odd who am i issue
V.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2009 09:35 AM
03-16-2009 09:35 AM
Re: odd who am i issue
oracle pts/0 Mar 16 07:40
root pts/1 Mar 16 10:23
root pts/2 Mar 16 12:29
$ who am i
$ who -m
$ whoami
rleon
$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2009 09:55 AM
03-16-2009 09:55 AM
Re: odd who am i issue
man whoami
whoami prints your current user name, even if you have used su to
change it since your initial login (see su(1)). The command who am i
reports your initial login name because it uses /etc/utmp.
...
If you was another user before and did a "su", only whoami will list this user, all other commands will list the user you was before you did the su.
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2009 10:19 AM
03-16-2009 10:19 AM
Re: odd who am i issue
I am getting into the server via telnet.
But either way .. If I did su the command will return a user name. In this case nothing is returned.
$ who
oracle pts/0 Mar 16 07:40
$ who
oracle pts/0 Mar 16 07:40
$ whoami
rleon
$ who am i
$ who -m
$ hostname
sanantu1
So now this is odd ....
via telnet it does not work but if i ssh in it does.
$ who
oracle pts/0 Mar 16 07:40
rleon pts/1 Mar 16 13:17
$ who am i
rleon pts/1 Mar 16 13:17
$ who -m
rleon pts/1 Mar 16 13:17
$ whoami
rleon
$ w
1:18pm up 5 days, 2:11, 2 users, load average: 0.31, 0.26, 0.24
User tty login@ idle JCPU PCPU what
oracle pts/0 7:40am 5:28 -ksh
rleon pts/1 1:17pm w
$
$
$ hostname
sanantu1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2009 10:41 AM
03-16-2009 10:41 AM
Re: odd who am i issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2009 11:05 AM
03-16-2009 11:05 AM
Re: odd who am i issue
Hi,
This should help from the from the technical knowledge base:
Regards
Michael
PROBLEM
who shows logins but no PID after a PC that was connected crashed and existed
incorrectly.
RESOLUTION
The utmp file can be manipulated with the fwtmp command.
1.check the last modification time of the /etc/utmp file
ls -l /etc/utmp
-rw-r--r-- 1 root root 1620 Jun 28 09:22 /etc/utmp
2.convert the binary /etc/utmp file to ascii :
/usr/sbin/acct/fwtmp /tmp/utmp.ascii
3.edit the /tmp/utmp.ascii file to remove the old entries
Note : the entries are sorted by date, simply use the login time reported
by
who(1) to find the lines to remove.
4.convert the file back to binary format :
/usr/sbin/acct/fwtmp -ic /tmp/utmp.binary
5.verify that all unwanted entries have been removed from the new file :
who /tmp/utmp.binary
6.verify that the /etc/utmp file has not been modified since the beginning of
this procedure :
ls -l /etc/utmp
-rw-r--r-- 1 root root 1620 Jun 28 09:22 /etc/utmp
If the file has been updated do all the steps again.
7.replace the existing /etc/utmp file with the new one :
mv /tmp/utmp.binary /etc/utmp
8.verify that the file still has the same ownership and permissions :
ls -l /etc/utmp
-rw-r--r-- 1 root root 1600 Jun 28 09:30 /etc/utmp
The who command will now report the correct information.
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=75984
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2009 11:06 AM
03-16-2009 11:06 AM
Re: odd who am i issue
oracle pts/0 Mar 16 07:40
rleon pts/ta Mar 16 14:04
$ whoami
rleon
$ who am i
rleon pts/ta Mar 16 14:04
$ w
2:06pm up 5 days, 2:59, 2 users, load average: 0.14, 0.17, 0.19
User tty login@ idle JCPU PCPU what
oracle pts/0 7:40am 32 -ksh
rleon pts/ta 2:04pm w
$