Windows遠端連線樹莓派
阿新 • • 發佈:2019-02-18
SSH
使用Windows上的Linux子系統通過ssh連線樹莓派。
- 安裝expect
sudo apt-get install tcl tk expect -
寫登陸指令碼
'''cd touch connect_to_pi.sh chmod +x connect_to_pi.sh vim connect_to_pi.sh // 以下為文字內容 #! /usr/bin/expect set timeout 3 set host "192.168.11.104" // your raspberrypi ip set username "pi" // your username set password "raspberrypi" // your password set timeout 10 spawn ssh
'''
-
使用指令碼登陸
'''cd ./connect_to_pi.sh
'''
-
使用命令別名執行指令碼
'''cd vim .bashrc // 檔案中新增下一行 alias sshpi="/home/xiaohei/connect_to_pi.sh" // 改為自己的使用者 :wq source .bashrc
'''
遠端圖形桌面
使用Windows遠端桌面連線樹莓派
- 樹莓派上安裝xrdp
- 遠端桌面