HP-UX – logname command is not working

last updated in Categories News

Asked by M. Sukumar


Q. When I logged into my server, I got these error
logname: could not get login name

I am not getting what is the problem for not executing these logname command in /etc/profile, and also I checked my /etc/utmp /etc/utpmx files are not corrupted. Skumar further tell us that he login over ssh, and he has tried the full path /usr/bin/logname, and permission are also good, but it is not working. Remaining commands like who , who am i , all are working properly. Further command ‘echo $LOGNAME’ giving him correct output.

A. Since files are /etc/utmp /etc/utpmx files are not corrupted, problem is basically related to sshd server. By setting UsePrivilegeSeparation from:

UsePrivilegeSeparation Yes


UsePrivilegeSeparation No

should fix the problem. Change the values in sshd_config file and restart the network. Please note that UsePrivilegeSeparation – specifies whether sshd separates privileges by creating an unprivileged child process to deal with incoming network traffic. After successful authentication, another process will be created that has the privilege of the authenticated user. The goal of privilege separation is to prevent privilege escalation by containing any corruption within the unprivileged processes. The default is “yes”. Privilege Separation should be always turned on for security. You should upgrade both sshd and HP-UX with up to date patches to solve this problem.


Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

1 comment

    Have a question? Post it on our forum!