树莓派4B安装Ubuntu

bridge
2021-02-24 / 0 评论 / 10 点赞 / 712 阅读 / 911 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2022-01-18,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

1.烧录系统

2.设置ubuntu密码

  • 初始账号密码: ubuntu
    image

3.设置网络

  • 打开配置文件
sudo vim /etc/netplan/50-cloud-init.yaml
  • wifi配置说明
network:
    ethernets:
        eth0:
            dhcp4: no
            optional: no
    wifis:
        wlan0:
            access-points:
                "JINGJIE_5G":               #wifi名称
                    password: jingjie2019   #wifi密码
            addresses: [192.168.0.177/24]   #固定IP
            gateway4: 192.168.0.1           #网关  
            nameservers:
                addresses: [8.8.8.8,114.114.114.114]    #DNS
    version: 2
  • 网线配置说明
network:
    ethernets:
        eth0:
            dhcp4: no                       #是否动态地址
            optional: true                  #可选
            addresses: [192.168.0.177/24]   #固定IP
            gateway4: 192.168.0.1           #网关
            nameservers:
                addresses: [8.8.8.8,114.114.114.114]    #DNS

    version: 2
  • 检查语法
sudo netplan generate
  • 使配置生效
sudo netplan apply
  • 查看ip地址
ip addr

4.配置 root 用户(可选)

  • 设置 root 用户密码
sudo passwd root
  • 启用 root 账号
sudo passwd --unlock root

5.设置root可以ssh访问

#修改配置文件
vim /etc/ssh/sshd_config

# Authentication:

LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes
StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

RSAAuthentication yes
PubkeyAuthentication yes

# 重启ssh
service ssh restart
0

评论区