HP-UX – logname command is not working

Asked by M. Sukumar

ADVERTISEMENTS

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

To

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.

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
1 comment… add one
  • Anonymous Nov 25, 2005 @ 18:09

    I had same problem thanks for you hints
    fantastic post… a massive help 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.