What Should I Do If Error Message "Permission denied" Is Displayed When I Remotely Log In to a Linux ECS?
Symptom
When I attempted to remotely log in to a Linux ECS, the system displayed error Message "Permission denied".


- To resolve this issue, you are required to restart the ECS and enter the rescue mode.
- Restarting the ECS may interrupt services. Exercise caution when performing this operation.
Root Cause
The nofile parameter in /etc/security/limits.conf is used to set the maximum number of files that can be opened in the system. If the value is greater than the fs.nr_open value (1048576 by default) set in PermissionDenied.png, a login verification error will occur, leading to "Permission denied".
Solution
- Entre no modo de usuário único.
O seguinte usa o CentOS 7 como exemplo:
- Reinicie o ECS e clique em Remote Login.
- Clique em Ctrl+Alt+Del na parte superior do painel de logon remoto para reiniciar o ECS.
- Pressione a tecla de direção para cima para evitar a inicialização automática do sistema. Quando os kernels forem exibidos, pressione e para entrar no modo de edição.
Figura 2 Entrar no modo de edição do kernel
O arquivo grub é criptografado por imagens Euler por padrão. Antes de entrar no modo de edição, você precisa entrar em contato com serviço ao cliente para obter nome de usuário e senha.
- Localize a linha contendo linux16 e exclua os parâmetros que você não precisa.
- Mude ro para rw para montar a partição raiz com permissões de leitura/gravação.
- Adicione rd.break e pressione Ctrl+X.
Figura 3 Antes da modificaçãoFigura 4 Após a modificação
- Execute o seguinte comando para ir para o diretório /sysroot:
# chroot /sysroot
- Run the following command to view the fs.nr_open value:
sysctl fs.nr_open
- Change the nofile value in /etc/security/limits.conf so that the value is smaller than the fs.nr_open value obtained in 2.
vi /etc/security/limits.conf
limits.conf is the pam_limits.so configuration file of Linux Pluggable Authentication Module (PAM). For more details, run the following command:
man limits.conf
- Restart the ECS and try to log in to it again.