一、開啟ssh服務首先需要安裝打開ssh服務的庫:
sudo apt-get install openssh-server
二、檢查當前的ssh開啟情況:
ps -e |grep ssh
三、如果有sshd,則ssh-server已經(jīng)啟動;若僅有agent,則尚未啟動;
開啟ssh服務:
/etc/init.d/ssh start 或者systemctl restart sshd
四、如果希望開機自動啟動ssh服務
sudo systemctl enable sshd
同樣的,關(guān)閉服務命令為:
sudo systemctl disable ssh
單次開啟服務
sudo systemctl start ssh
單次關(guān)閉服務
sudo systemctl stop ssh
針對自啟動命令,輸入之后reboot就可以,使用sudo systemctl status sshd命令查看ssh是否啟動,看到Active: active (running)即表示成功
如果單純開啟ssh服務,那就ps查看ssh,再/etc/init.d/ssh start 或者systemctl restart sshd文章來源:http://www.zghlxwxcb.cn/news/detail-487000.html
連接xshell的時候一直連接不上, 重啟之后也是不管用,這時候ifconfig查看虛擬機的網(wǎng)卡是否發(fā)生變化,因為ip非靜態(tài)文章來源地址http://www.zghlxwxcb.cn/news/detail-487000.html
到了這里,關(guān)于ubuntu重啟ssh服務的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!