今天在用 netbeans 开发c++,打算用linux的c++编辑,在连接 ssh的时候报错,无法连接,一直在转圈,linux message报:
Dec 27 10:01:01 yunxiang-PC systemd: Created slice user-0.slice.
Dec 27 10:01:01 yunxiang-PC systemd: Starting user-0.slice.
Dec 27 10:01:01 yunxiang-PC systemd: Started Session 453 of user root.
Dec 27 10:01:01 yunxiang-PC systemd: Starting Session 453 of user root.
Dec 27 10:01:02 yunxiang-PC systemd: Removed slice user-0.slice.
Dec 27 10:01:02 yunxiang-PC systemd: Stopping user-0.slice.
secure:
Dec 28 19:42:32 yunxiang-PC sshd[19022]: error: Received disconnect from 192.168.1.60: 3: java.net.SocketTimeoutException: Read timed out [preauth]
查到最后发现是 DNS无法解析,需要修改 /etc/ssh/sshd_config
#UseDNS yes
UseDNS no
禁用 DNS
Dec 27 10:01:01 yunxiang-PC systemd: Created slice user-0.slice.
Dec 27 10:01:01 yunxiang-PC systemd: Starting user-0.slice.
Dec 27 10:01:01 yunxiang-PC systemd: Started Session 453 of user root.
Dec 27 10:01:01 yunxiang-PC systemd: Starting Session 453 of user root.
Dec 27 10:01:02 yunxiang-PC systemd: Removed slice user-0.slice.
Dec 27 10:01:02 yunxiang-PC systemd: Stopping user-0.slice.
secure:
Dec 28 19:42:32 yunxiang-PC sshd[19022]: error: Received disconnect from 192.168.1.60: 3: java.net.SocketTimeoutException: Read timed out [preauth]
查到最后发现是 DNS无法解析,需要修改 /etc/ssh/sshd_config
#UseDNS yes
UseDNS no
禁用 DNS