SSH connection stuck solution



Both the local machine and the server are on the same intranet and can ping each other. However, when the local machine SSH connects to the server remotely, the terminal input command will always get stuck.
It was tested that while Caton was on the Internet, they could not Ping each other when losing packets, but both had no problem accessing the Internet.

Reason 1: the ssh server enables DNS query by default:UseDNS=yes

WhenUseDNSWhen the option is on, the client attempts to log in to the ssh server. The server first reversely queries the host name of the client by DNS PTR according to the IP address of the client, and then queries the DNS forward a record according to the queried host name of the client to verify whether it is consistent with its original IP address, which is a measure to prevent the client from cheating, But generally, we don’t have PTR records for dynamic IP. Turning on this option is just a waste of time. It’s better to turn it off.

vim /etc/ssh/sshd_config
   #Add this option
   service sshd restart
   #Restart sshd service
Reason 2: if GSSAPI login authentication mode is enabled on ssh server:GSSAPIAuthentication=yes, not enabled by default

GSSAPI is the public security transaction application program interface (GSS-API)
Whether GSSAPI authentication allows user authentication based on GSSAPI. The default value is “no”. It is only used for ssh-2
Whether gssapicleanupcredentials automatically destroys the user credential cache after the user logs out. The default value is “yes”. It is only used for ssh-2
If the server turns on the authentication mechanism, but the client does not use the authentication mechanism, the authentication process will be delayed

vim /etc/ssh/sshd_config
   #Turn off GSSAPI authentication mechanism
   service sshd restart
   #Restart sshd service

This work adoptsCC agreement, reprint must indicate the author and the link to this article

Recommended Today

Glue of R string

preface Today we want to introducetidyversePackages that format strings in:glue glueProvides lightweight, fast, and dependency free interpretable strings,glueBy willRThe expression is embedded in curly braces, then evaluated and inserted into the string. install install.packages(“glue”) # or install.packages(“glue”) # install.packages(“devtools”) devtools::install_github(“tidyverse/glue”) use 1. Import library(glue) 2. Simple use Pass the variable directly into the string > […]