1.烧录系统
2.设置ubuntu密码
- 初始账号密码: ubuntu
3.设置网络
sudo vim /etc/netplan/50-cloud-init.yaml
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 addr
4.配置 root 用户(可选)
sudo passwd 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
评论区