ssh: connect to host xx.xx.xxx.xxx port 22: Connection refused


執行 ssh root@47.94.142.215

報錯

 

首先要開啟ssh

系統偏好設置-共享

選上遠程登陸

選上遠程管理

 

檢測openssh-server是否安裝成功 ,安裝成功的如下

ps -e | grep ssh

 

 

mac本身安裝了ssh服務,默認情況下不會開機自啟

1.啟動sshd服務:
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist

2.停止sshd服務:
sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist

檢查是否啟動ssh,啟動了的 如下

sudo launchctl list | grep ssh

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM