What Do I Do If "pam_unix(sshdsession) session closed for user" Is Reported When I SSH Into a Linux ECS?
Symptom
When you log in to a Linux ECS using SSH, the following error information is displayed in the command line or secure log even if you enter the correct password. As a result, the connection fails.
- This account is currently not available.
- Connection to 127.0.0.1 closed.
- Received disconnect from 127.0.0.1: 11: disconnected by user.
- pam_unix(sshd:session): session closed for user test.
Possible Causes
The default shell of the corresponding user is modified.
Solution
- Remotely log in to the ECS.
- Run the following command to check the default shell of the corresponding user:
Check whether the shell of the corresponding user is changed to nologin.
test:x:1000:1000::/home/test:/sbin/nologin
- If you need to modify relevant policy configuration, you are advised to back up the file before continuing.
- Run the following command to change the default shell of the corresponding user to bash:
vi /etc/passwd
- Change /sbin/nologin to /bin/bash.
- Use the SSH client to reconnect to the server.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot