通過 SSH 遠程連接(命令行方式)
🔧 所需工具:
Windows:MobaXterm(強烈推薦)或 PuTTY
Ubuntu:已開啟 SSH 服務
Ubuntu 開啟 SSH 服務(僅需一次)
在 Ubuntu 上運行以下命令:
sudo apt update
sudo apt install openssh-server
sudo systemctl enable ssh
sudo systemctl start ssh
確認是否正在運行:
sudo systemctl status ssh
記錄 Ubuntu 的 IP 地址(例如 192.168.1.100):
ip a
Windows 使用 MobaXterm 連接 Ubuntu:
1、打開 MobaXterm → 點擊左上角 Session
→ 選擇 SSH
2、輸入:
-
Remote host:
192.168.1.100
(Ubuntu IP) -
Specify username:
ubuntu 用戶名
(如yourname
)
3、點擊 OK,首次連接會提示接受密鑰,輸入 Ubuntu 密碼即可登錄。