Linux
1.安裝並開啟SSH
sudo apt-get install openssh-server
sudo /etc/init.d/ssh start
2.查看ubuntu地址
ifconfig
Windows
1.安裝MobaXterm, 按序號順序執行
使用root用戶登錄linux顯示access denied
分析原因:一般linux系統是默認禁止遠程登錄root用戶
解決辦法:需要修改 /etc/ssh/ssh_config 配置,允許登錄
1.編輯配置文件
命令:vi /etc/ssh/sshd_config
2.文件中找到PermitRootLogin
#PermitRootLogin without-password
將#去掉,without-password改為yes
PermitRootLogin yes
3.退出並保存,重啟ssh
命令:service sshd restart
ubuntu操作openssh-server指令
1、先停掉SSH服務:sudo stop ssh
2、卸載openssh-server:apt-get remove openssh-server
3、卸載openssh-client: apt-get remove openssh-client
4、安裝openssh-server:apt-get install openssh-server
5、安裝openssh-client:apt-get install openssh-client
6、安裝完成以后,啟動服務:sudo /etc/init.d/ssh start
7、啟動后,查看服務是否正確啟動: ps -e|grep ssh
ubuntu20 sshd_config文件內容:【請點擊鏈接:https://www.cnblogs.com/axinno1/p/14609658.html】
參考資料:https://blog.csdn.net/qq_37124717/article/details/104639369