Issue/Introduction
This article describes how to troubleshoot a slow SSH connection to a VM instance when the network is normal. It applies to the initial diagnosis and resolution of similar issues in ZStack Cloud.
Environment
- Product: ZCF
- Component: Cloud
- Version: 3.x-5.5.30
Symptoms
When the network is normal, establishing an SSH connection to the VM instance is slow.
Possible causes
Possible causes include:
- SSH reverse DNS lookup is enabled, and the lookup takes a long time.
- GSS, or Generic Security Services, authentication is enabled, and authentication takes a long time.
- NSS, or Name Service Switch, name resolution takes a long time.
Resolution
- Disable SSH reverse DNS lookup.
Run the following command and change the setting to disable SSH reverse DNS lookup:
[root@localhost~]#vi /etc/ssh/sshd_config
# Edit sshd_config and change the following setting
UseDNS=no
- Disable GSS authentication.
Run the following command and change the setting to disable GSS authentication:
[root@localhost~]#vi /etc/ssh/sshd_config
# Edit sshd_config and change the following setting
GSSAPIAuthentication no
When the GSS authentication method is set to gssapi-with-mic, GSSAPI authentication is performed each time an SSH connection to the VM instance is established, and the process takes a long time. Therefore, disabling GSS authentication can increase the SSH connection speed.
- Modify
nsswitch.confon the VM instance.
Run the following command and change the setting in nsswitch.conf:
#vi /etc/nsswitch.conf
# Edit nsswitch.conf and change the following setting
hosts: files
