Ubuntu 開啓遠程ssh服務

1、實驗要求segmentfault

1. 在安裝好的Ubuntu 16.04 LTS 64位系統中開啓遠程服務ssh

2. 並用SecureCRT 進行遠程工具

2、步驟測試

1. 因爲系統安裝的時候並無安裝openssh spa

更新系統工具和依賴:
sudo apt-get update
執行安裝命令
sudo apt-get install openssh-server openssh-client

2. 啓動sshrest

    先查看ssh是否在運行,執行命令sudo ps -e |grep ssh,若是沒有任何顯示,是沒有運行ssh服務的.反之,出現sshd字樣,表示ssh服務已運行.code

    若是ssh沒有運行,使用,命令sudo service ssh start啓動.server

#啓動
/etc/init.d/ssh start
#中止
/etc/init.d/ssh stop
#從新啓動
/etc/init.d/ssh restart

#利用service命令
#啓動
sudo service ssh start
#中止
sudo service ssh stop
#從新啓動
sudo service ssh restart

3. 修改配置文件blog

注意:這裏的配置文件是 sudo /etc/ssh/sshd_configget

使用命名打開配置文件:sudo vi /etc/ssh/sshd_config
將配置文件中的PermitRootLogin without-password一行註釋掉;
添加新的一行內容:PermitRootLogin yes;
保存配置文件,重啓ssh服務.

4. 遠程鏈接測試

在SecureCRT中配置好本機對應的IP和端口號便可遠程

參考:https://segmentfault.com/a/1190000004686476

相關文章
相關標籤/搜索