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:
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 Linux, Open Source & DevOps via:
|Category||List of Unix and Linux commands|
|Firewall||Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04|
|Network Utilities||dig • host • ip • nmap|
|OpenVPN||CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04|
|Package Manager||apk • apt|
|Processes Management||bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time|
|Searching||grep • whereis • which|
|User Information||groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w|
|WireGuard VPN||Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04|