ssh方式登录树莓派

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    //命令打开远程连窗口

在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值