- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Wrong user logname
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
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
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
08-22-2002 04:12 PM
08-22-2002 04:12 PM
Wrong user logname
command whoami
output A
command echo $LOGNAME
output A
command logname
output X (this is wrong it should have been A)
the wrong output seems to be always one of a set of three user names. We have deleted those users. So now X is not even a valid unix user.
We have checked utmp file there are no entries for X in it.
id command returns all vaid answers.
Any idea what might be causing the problem and how to fix it.
Have a lovely day.
Regards
Kafsat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 04:22 PM
08-22-2002 04:22 PM
Re: Wrong user logname
Run the 'pwck' command to check the rest of your password file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 04:31 PM
08-22-2002 04:31 PM
Re: Wrong user logname
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 04:49 PM
08-22-2002 04:49 PM
Re: Wrong user logname
No points here please.
But as a security freak can I ask what application absolutely requires multiple users to share userid 0 with different usernames???
It really sounds like an application design flaw to me, but that's my soapbox speaking, being a former reformed applciation programmer.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 05:02 PM
08-22-2002 05:02 PM
Re: Wrong user logname
Auditors would have a field day with this system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2002 05:06 PM
08-22-2002 05:06 PM
Re: Wrong user logname
I don't think it is the source of problem, we are running this application for more then 7 years with same configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2002 01:50 AM
08-23-2002 01:50 AM
Re: Wrong user logname
The logname(1) *command* gets its info from /etc/utmp. See getlogin(2) which is mentioned in the logname(1) manual page.
The LOGNAME *variable* is set to the new user A).
You will see that "who am i" (*with* spaces between the words) will also show X. For details see the who(1) manual page for "who am i" and the whoami(1) manual page for "whoami".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2002 01:57 AM
08-30-2002 01:57 AM
Re: Wrong user logname
I have the same problem on several machines running HPUX 11.00.
Details:
- Only root as uid 0
- 'whoami' --> root
- 'who am i' --> root
- 'id' --> uid=0(root) gid=...
- 'logname' --> webob
- 'su - oracle8' --> entry in syslog.log: "... su : + 0 webob-oracle8"
- 'mailx ...' --> mail is sent from user webob
- 'userdel ..webob ...' --> the same behaviour
Facts I have found out:
- It's not always the same username
- The wrong username must not exist on the machine, even the wrong user had never exist on the system
- The information about the username came from the Files /etc/utmp /etc/utmpx or /etc/wtmp
Possible reason:
It depends on how to login: no problems with telnet or rlogin.
We uses openssh 2.9.9p2 as ssh-server and only actions running from ssh-Windows have the wrong logname.
In next future we will install openssh 3.x and I hope the problem will be solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2002 02:38 AM
08-30-2002 02:38 AM
Re: Wrong user logname
excuse me, I have forgotten to write down a (quick and maybe dirty) fix of the problem:
Backup the files /etc/utmp /etc/utmpx /var/adm/wtmpx /var/adm/wtmp
cp /dev/null /etc/utmp
...
logout/login, 'logname' will now give the correct answer.
Remember: You will loose current logon-information (e.g. 'who' is working incorrectly)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2002 06:08 AM
08-30-2002 06:08 AM
Re: Wrong user logname
As for multiple users with UID=0, there are pros and cons. Our auditing department requires them for auditing purposes. They do come in handy when something happens to the root account (like being locked out with too many incorrect attempts).
HTH
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2002 12:10 PM
08-31-2002 12:10 PM
Re: Wrong user logname
My 0.02???, NO, use sudo, suid (careful, another can of worms)
Personally I prefer to see suid rather than multiple uid=0 because
1 - Roots password can be secret, as there is only 1
2 - suid progs should be "well" maintained to do specific jobs than need to be done by root.
3 - The password file will be "supported" e.g. finger, resolving user names utmp/wtmp/btmp etc, & general tracability (last)
The above said the "King" is sudo. It may not be perfect (you can inadvertently leave security loopholes, like vi!). But it goes along way to allowing restriced, audited access to potentially "dangerous" commands (like "chmod", consider "chmod -R 444 /"!)
Regards
Tim