linux開啟ssh服務


sudo apt-get install openssh-server
啟動ssh服務
sudo /etc/init.d/ssh start
設置開機自啟動
sudo systemctl enable ssh
關閉ssh開機自動啟動命令
sudo systemctl disable ssh
單次開啟ssh
sudo systemctl start ssh
單次關閉ssh
sudo systemctl stop ssh
設置好后重啟
reboot

 

如果安裝openssh-server失敗,提示依賴錯誤的問題時

如:Unable to correct problems, you have held broken packages.

解決方法:

使用aptitude安裝可以自動的解決依賴問題

apt install aptitude

aptitude install openssh-server
#aptitude安裝過程會給出很多中解決方案,安裝過程會提示Y/N/q 如果默認的方案解決不了可以摁N換一個方案

 


免責聲明!

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



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