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 $username@$host expect "*password*" {send "$password\r"} interact // 文本结束 :wq
'''
-
使用脚本登陆
'''cd ./connect_to_pi.sh
'''
-
使用命令别名运行脚本
'''cd vim .bashrc // 文件中添加下一行 alias sshpi="/home/xiaohei/connect_to_pi.sh" // 改为自己的用户 :wq source .bashrc
'''
远程图形桌面
使用Windows远程桌面连接树莓派
- 树莓派上安装xrdp
- 远程桌面
参考: https://blog.csdn.net/donglyn...