What should I do if the error message "Permission denied, please try again" is displayed?
1. Problem description
When logging in to the ECS instance of the Linux system through the local SSH client, even if the correct password is entered, an error message similar to the following appears.
• Permission denied, please try again.
• The SSH server rejected the password, please try again.
2. The cause of the problem
This problem may be caused by the following reasons:
• Disable root user login in the ECS instance: The parameter PermitRootLogin or PasswordAuthentication in the configuration file /etc/ssh/sshd_config corresponding to the SSH service is set to no. You can refer to the solution to the problem caused by prohibiting the root user from logging in.
1) PermitRootLogin is set to no, which means that root user login is disabled.
2) PasswordAuthentication is set to no, which means that the password login is disabled, but the key login can be used.
• The SELinux service is enabled on the Linux system, which prevents root users and ordinary users from logging in.
Execute cat /var/log/secure to view the secure log. If the log contains error: Could not get shadow infromation for root., it means that the SELinux service is enabled. You can refer to the solutions to problems caused by the SELinux service.
3. The solution to the problem caused by prohibiting root user login
• Log in to the ECS instance using VNC.
• Check the parameter PermitRootLogin or PasswordAuthentication configuration in /etc/ssh/sshd_config.
• Modify the parameter configurations of PermitRootLogin and PasswordAuthentication according to business requirements.
1) Open the SSH configuration file.
2) Modify the parameter value configuration of PermitRootLogin and PasswordAuthentication.
3) Press the Esc key and enter: wq to save the modification.
• Restart the SSH service.
4. Solutions to problems caused by SELinux services
You can choose to temporarily or permanently disable the SELinux service to solve the problem of abnormal SSH connection according to the actual situation.
5. Check SELinux service status
• Log in to the ECS instance using VNC.
• View the current SELinux service status.
Temporarily shut down the SELinux service
• Log in to the ECS instance using VNC.
• Execute the following command to temporarily disable SELinux.
setenforce 0
Permanently shut down the SELinux service
• Log in to the ECS instance using VNC.
• Execute the following command to permanently disable the SELinux service.
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
Related Articles
-
A detailed explanation of Hadoop core architecture HDFS
Knowledge Base Team
-
What Does IOT Mean
Knowledge Base Team
-
6 Optional Technologies for Data Storage
Knowledge Base Team
-
What Is Blockchain Technology
Knowledge Base Team
Explore More Special Offers
-
Short Message Service(SMS) & Mail Service
50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00