Red Hat Enterprise Linux Diagnostics and Troubleshooting
Diagnose and correct an authentication-related issue.
Outcomes
You should be able to resolve authentication-related issues.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
[student@workstation ~]$ lab start security-authentication
This command configures an FTP server and modifies PAM configuration files.
Instructions
Despite the security risks, your company provides authenticated FTP access to home directories on the serverb system. After a recent change, users report that they cannot log in to the FTP server. You are tasked to restore authenticated FTP access. Use the ftpuser account with the redhat password to troubleshoot the issue.
Log in to the
serverasystem and switch to therootuser.[student@workstation ~]$
ssh student@servera...output omitted... [student@servera ~]$sudo -i[sudo] password for student:student[root@servera ~]#Attempt to log in to the FTP server.
Run the
lftpcommand to log in as theftpuseruser.[root@servera ~]#
lftp ftpuser@serverb.lab.example.comPassword:redhatlftp ftpuser@serverb.lab.example.com:~>FTP servers authenticate users only when they execute a command. Run an
lscommand to cause the authentication attempt and error. Do not exit thelftpprompt.lftp ftpuser@serverb.lab.example.com:~>
lsls: Login failed: 530 Login incorrect.
Gather more troubleshooting information.
From the
workstationsystem, open a second terminal. Log in to theserverbsystem and switch to therootuser.[student@workstation ~]$
ssh student@serverb...output omitted... [student@serverb ~]$sudo -i[sudo] password for student:student[root@serverb ~]#View the
/var/log/securefile to locate FTP-related authentication errors.The log file indicates a problem with the
vsftpdPAM configuration file.[root@serverb ~]#
tail -n 10 /var/log/secure...output omitted... Nov 8 12:03:52 server vsftpd[2010]: PAM unable to resolve symbol: pam_sm_acct_mgmt ...output omitted...Verify if any files that belong to the
vsftpdpackage changed since installation.The output indicates that the
vsftpdPAM configuration changed.[root@serverb ~]#
rpm -V vsftpdS.5....T. c /etc/pam.d/vsftpd
Restore the
vsftpdPAM configuration file. Keep a backup of the broken file.Rename the broken file.
[root@serverb ~]#
mv /etc/pam.d/vsftpd{,.broken}Reinstall the
vsftpdpackage.[root@serverb ~]#
yum reinstall vsftpdNote
The broken file is moved, not copied, because the
yumcommand by default does not overwrite configuration files when reinstalling. The broken file would remain if thecpcommand was used.
Test whether authenticated FTP access is restored, and then analyze why the modified PAM configuration file did not work.
On the
serverasystem, test whether authenticated FTP access is restored.lftp ftpuser@serverb.lab.example.com:~>
ls-rw-r--r-- 1 0 0 12 Feb 17 12:05 README.txtNote
If the authentication error persists, then exit the
lftpprompt and reconnect to the FTP server.On the
serverbsystem, compare the/etc/pam.d/vsftpdand/etc/pam.d/vsftpd.brokenfiles.[root@serverb ~]#
diff -u /etc/pam.d/vsftpd{,.broken}...output omitted... +account required pam_ftp.so ...output omitted...The broken file has an extra requirement to use the
pam_ftp.somodule.Read the
pam_ftpmodule's documentation to determine why it caused an authentication error.[root@serverb ~]#
man pam_ftpAccording to the man page, the
pam_ftp.somodule provides anonymous FTP access. However, the module is available for use only inauthrules and not inaccountrules.
Exit the second terminal. Return to
workstationas thestudentuser.[root@serverb ~]#
exit[student@serverb ~]$exit[student@workstation ~]$exitlftp ftpuser@serverb.lab.example.com:~>
exit[root@servera ~]#exit[student@servera ~]$exit[student@workstation ~]$