Disclaimer: This article may contain information about third-party products. Such information is for reference only. Alibaba Cloud does not make any guarantee, express or implied, with respect to the performance and reliability of third-party products, as well as potential impacts of operations on the products.
When you use an SSH command to log on to an ECS instance of the Linux system, the connection fails even if you use a normal account and password. Errors similar to the following are also displayed in the command-line or secure logs.
- 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.
This problem is usually caused by the modification of the default Shell of the corresponding user.
- Log on to an instance. For more information about how to log on to an instance, seeConnect to a Linux instance by using a management Terminal.
- Run the following command to view the default Shell of the corresponding user.
Cat/etc/passwd | grep testThe command output is as follows. The Shell of the logon user is changed to nologin.
- We recommend that you back up files before you modify the policy configuration.
- Run the following command to edit
/Etc/passwdFile, and change the default Shell of the corresponding user to bash, that is
/Bin/bashSave the settings and exit.
- Try to connect to the server again on the client and make sure that the connection is normal.
Tips: If you have any questions, seeGuidelines for troubleshooting failure to remotely log on to Linux instances through SSH.