ssh方式登录树莓派
登录前配置网络准备工作
一、 让树莓派入网
命令行输入
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
修改
进入nano 文档编辑器配置网络界面
Ctrl+o 保存,会有提示是否写入。我们按回车。Ctrl+x退出
GNU nano 2.7.4 File: /etc/wpa_supplicant/wpa_supplicant.conf
[ 112.316081] Under-voltage detected! (0x00050005)tdev
update_config=1
[ Read 9 lines ]
^G Get Help ^O Write Out ^W Where Is ^K Cut Text ^J Justify ^C Cur Pos
^X Exit ^R Read File ^\ Replace ^U Uncut Text^T To Spell ^_ Go To Line
添加如下:
network={
ssid="wifipig"
psk="123456789"
}
接着重启
sudo reboot
查看接入的网络
ifconif
二、固定树莓派的ip地址
sudo nano /etc/rc.local
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
//固定地址配置:
ifconfig wlano 192.168.101.10
exit 0
三、ssh网络登录
1、 打开ssh功能;设置网络登录
1.1、终端输入以下命令
sudo raspi-config
1.2、选择地5项
1.3、选择SSH方式
1.4确定
2、登录:
3、 VIM更新到好用的版本
默认的源是国外的,apt-get 安装的时候失败,我们更新成国内的源
地址:https://blog.csdn.net/Liu_959185/article/details/86636906
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
步骤如下:
a、打开编辑器sources.list
终端命令输入
sudo nano /etc/apt/sources.list
b、在sources.list更改内容
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
#deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
c、sudo apt-get update 更新源
d、sudo apt-get install vim 安装新版vim
2、 图形方式登录树莓派
需要安装相应的xrdp库:
sudo apt-get install xrdp
windows用“远程桌面连接”自带软件登录
如下:
cmd窗口输入
mstsc //命令打开远程连窗口