
這是我在 stackexchange 上的第一篇文章,我是 Linux 新手,所以如果我有任何不當行為,請告訴我。
每次我嘗試 ssh(或 telnet)到非本地主機的任何地方時,由於連接逾時,我無法連接。運行 ssh -vvv 後的輸出範例[電子郵件受保護]:
ssh -vvv [email protected]
OpenSSH_8.9p1 Ubuntu-3, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /home/klnsptr/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/klnsptr/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/klnsptr/.ssh/known_hosts2'
debug2: resolving "github.com" port 22
debug3: resolve_host: lookup github.com:22
debug3: ssh_connect_direct: entering
debug1: Connecting to github.com [140.82.121.3] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x10
debug1: connect to address 140.82.121.3 port 22: Connection timed out
ssh: connect to host github.com port 22: Connection timed out
另一件事是,如果我透過 https 進行克隆,我可以克隆 github 儲存庫。然而,嘗試使用 ssh 位址時會出現「複製到‘x’...」提示,然後逾時。
我不認為問題出在我的 ISP 上,因為 ssh 在我的 Windows 10(使用 PuTTY)以及連接到相同網路的 Macbook 上運行得非常好。
另外,我的防火牆已關閉,所以這也不是問題。
嘗試過:重新安裝ssh,重新啟動系統,重新啟動路由器,刪除ssh_config。谷歌搜尋沒有解決這個問題。
我的設定是:在一個 SSD (C:) 上安裝 Ubuntu 22.04,另一塊 SSD (D:) 上安裝 Win 10。使用 grub 引導至其中之一。這台電腦透過乙太網路線連接到我從 ISP 獲得的庫存路由器。
我該如何解決?
謝謝
編輯:-no vpn -防火牆關閉(ufw狀態:非活動)
編輯2:重新安裝ubuntu,問題仍然存在。
編輯3:所以我從安裝ubuntu的同一個iso創建了一個虛擬機,只是為了檢查會發生什麼。事實證明 ssh 在虛擬機器中可以工作。 (???)
編輯4:再次重新安裝ubuntu,更新到22.10 - 什麼都沒有。然後,我降級到 20.04 - 問題解決了,ssh 現在工作得很好。但是,如果有人有任何想法,我仍在尋找 22.04 的解決方案。