新裝 CentOS 虛擬機,Putty 連線提示 Network error: Connection refused,但 ping 正常。原因通常是 sshd 未安裝/未啟動或防火牆封鎖 22 埠。
ssh localhostConnection refused 表示服務未啟動。yum install openssh-server/etc/init.d/sshd start (CentOS 6)systemctl start sshd (CentOS 7/8)iptables -I INPUT -p tcp --dport 22 -j ACCEPT && service iptables savefirewall-cmd --permanent --add-port=22/tcp && firewall-cmd --reloadservice iptables stop / systemctl stop firewalldchkconfig sshd on / systemctl enable sshdPutty 輸入虛擬機 IP,連線成功出現 login as: 提示即表示修復完成。
依序執行上述步驟,即可解決 99% 的 Connection refused 問題。
Linux 磁碟 I/O 性能分析實戰:iostat 關鍵指標解讀與瓶頸判斷
Linux rz/sz 傳輸大檔案導致 Shell 崩潰?啟用 ZModem 轉義模式解決
Windows Server Manager 遠程磁碟管理配置指南
安裝 Windows XP 後 Linux 無法啟動?修復 GRUB 引導的完整步驟
Linux 文件時間戳詳解:atime、mtime、ctime 區別與應用
Linux 批量替換文件內容神技:find + xargs + Perl 一鍵搞定 700+ pom.xml