gitlab配置ssh连接,先跟着教程生成密钥,上传公钥,将服务器信息存入config文件,但是ssh连接超时,很急,想用服务器,各种搜索尝试,搞了两三天别的什么都没干,还是没解决,绝望
问题1. ssh: connect to host xx.xx.xx.x port xxxx: Connection timed out
已知服务器端没有问题,别人可以登上
尝试ping远程服务器,不通,报错
尝试ping百度,可以,不是网络的问题
尝试ssh -T git@github.com
The authenticity of host 'github.com (20.205.243.166)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Host key verification failed.
尝试:在vscode的remote ssh里设置:
没用
尝试:关闭防火墙
没用
问题2:Host key verification failed.
尝试加“-v”看看问题出在哪里 ssh -vT git@github.com
ssh -vT git@github.com
>>
OpenSSH_9.4p1, OpenSSL 3.1.2 1 Aug 2023
debug1: Reading configuration data /c/Users/15958/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to github.com [20.205.243.166] port 22.
debug1: Connection established.
debug1: identity file /c/Users/15958/.ssh/id_rsa type 0
debug1: identity file /c/Users/15958/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/15958/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/15958/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/15958/.ssh/id_ecdsa_sk type -1
debug1: identity file /c/Users/15958/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /c/Users/15958/.ssh/id_ed25519 type -1
debug1: identity file /c/Users/15958/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/15958/.ssh/id_ed25519_sk type -1
debug1: identity file /c/Users/15958/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /c/Users/15958/.ssh/id_xmss type -1
debug1: identity file /c/Users/15958/.ssh/id_xmss-cert type -1
debug1: identity file /c/Users/15958/.ssh/id_dsa type -1
debug1: identity file /c/Users/15958/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.4
debug1: Remote protocol version 2.0, remote software version babeld-05989c77
debug1: compat_banner: no match: babeld-05989c77
debug1: Authenticating to github.com:22 as 'git'
debug1: load_hostkeys: fopen /c/Users/15958/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU
debug1: load_hostkeys: fopen /c/Users/15958/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: hostkeys_find_by_key_hostfile: hostkeys file /c/Users/15958/.ssh/known_hosts2 does not exist
debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts does not exist
debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts2 does not exist
The authenticity of host 'github.com (20.205.243.166)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
Host key verification failed.
问题3. ping不通服务器,请求超时