1:安装最小化Ubuntu访问外网,配置ssh,修改root密码
1:编辑网卡配置文件
vim /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto enp96s0f0
iface enp96s0f0 inet static #设置静态IP
address 10.151.5.144 #IP
netmask 255.255.255.0 #子网掩码
network 10.151.5.0 #网段
broadcast 10.151.5.255 #广播地址
gateway 10.151.5.254 #网关
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 10.8.8.8 #DNS
2:重启网卡
service networking restart
设置开机自动重启
systemctl enable networking.service
3:如果配置了还是不能访问网关或者外网,则查看/etc/resolv.conf文件里配置的dns地址和网卡配置的是否一样
或者把ip配到其他网卡试试,把enp96s0f0的配置配置到enp24s0f0上,修改/etc/network/interfaces里的网卡名字即可,注意:修改后需重启机器生效
4:配置ssh
1:更新apt-get 源
apt-get update
2:安装ssh包
apt-get -y install openssh-server
3:配置允许root远程登陆
vim /etc/ssh/sshd_config
设置:PermitRootLogin yes
5:修改root密码
系统创建的用户输入:sudo passwd
1: 输入普通用户密码:xxx
2:输入root密码:xxx
3:再次输入root密码:xxx
4:完成
验证: su root
输入修改的密码: xxx