Problem description
When you connect to a Linux ECS instance by using SSH, the following error message appears in the command output or secure log even after you enter the correct password:
Permission denied, please try again.
error: Could not get shadow information for root.
Cause
The SELinux service is enabled.
Solution
Temporarily or permanently disable the SELinux service to resolve the SSH connection exception. For more information, see Enable or disable SELinux.
Check the status of SELinux.
Use the rescue feature to connect to the simple application server. For more information, see Connect to a Linux server by using the rescue feature.
Run the following command to view the status of SELinux:
/usr/sbin/sestatus -v
Sample output:
SELinux status: enabled
NoteValid values:
enabled: SELinux is enabled.
disabled: SELinux is disabled.
Disable SELinux.
Temporarily disable SELinux
Run the following command to temporarily disable SELinux:
setenforce 0
Permanently disable SELinux
Run the following command to permanently disable SELinux:
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
NoteYou can use the preceding command only if SELinux is in the
enforcing
state.Restart the server to allow the setting to take effect. For more information, see View server information.