Today, I want to install a monit on VPs for monitoring. I did not expect that I had a problem for almost a day.
The source of the problem is that monit depends on linuxpam. I didn't know much about this before. I thought it was just a common dependent library, so I didn't pay much attention to it. I didn't expect a day to be wasted.
After the PAM is installed, monit is successfully installed. But I suddenly found that SSH cannot be connected to VPs! I thought it was a problem with my local xshell. I broke the current connection (why do I need to break t_t) and tried to connect to other servers. I tried several of them, but the VPs won't work. So I started a day-on-day task...
I tried to restart the VPs and reset the root password. I contacted linode's customer service. We recommend that you reset the root password and use Lish (a shell of linode) to connect to linode. I tried it several times but failed. Later, I used a screen recording software to record the login information, and then played it back slowly to see it. There was a transient error message during login.
This is finally a little eye-catching. I didn't know it was because of PAM problems.
After communicating with customer service, we suggest using "rescue mode ". This mode is a bit like winpe. It will log into a complete and small Linux Shell, and then read and write the disk files in VPS through Mount. In this way, I tried to modify the file more than 10 times. Restart the VPs every time you exit from the rescue mode to perform a logon test. PAM Configuration is always incorrect. Last Modified'/Etc/ssh/sshd_config''In''Usepam No'. SSH is successfully logged on. After logging on, I want to change the root password because I just changed it for half a day and want to change it back to my previous password.Passwd''Again, we saw the PAM failure error. I checked it online and accidentally added the/etc/PAM. d/other file.
#%PAM-1.0 # auth required/lib/security/$ ISA/pam_deny.so # account required/lib/security/$ ISA/pam_deny.so # Password required/lib/security/$ ISA/pam_deny.so # session required/lib/security/$ ISA/pam_deny.soauth required pam_unix.soaccount required pam_unix.sopassword required pam_unix.sosession required pam_unix.so
Started a bunch of software and applications. Now, the VPs is restored. I quickly wrote a script to back up the entire site, and uploaded the website and nginx configuration information to the Baidu disk. Well, I don't think I can afford Pam...
In other words, linode's quick response and professional opinions are really worth the price.
An error occurred while logging on to the VPs caused by PAM failure.