- 修改root密码
sudo passwd root
- 设置root可以远程登录
默认不带ssh,所以需要安装一下ssh
sudo apt install openssh-server
允许root用户登录,编辑sshd_config
sudo vim /etc/ssh/sshd_config 找到# Authentication项下的 PermitRootLogin prohibit-password改成PermitRootLogin yes
重启ssh搞定
sudo systemctl restart sshd
- 更换国内源
备份
sudo cp /etc/apt/sources.list /etc/apt/sources_init.list
编辑/etc/apt/sources.list 更换阿里源
阿里源 deb http://mirrors.aliyun.com/ubuntu/ xenial main deb-src http://mirrors.aliyun.com/ubuntu/ xenial main deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main deb http://mirrors.aliyun.com/ubuntu/ xenial universe deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe deb http://mirrors.aliyun.com/ubuntu/ xenial-security main deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
更新
apt-get update
apt-get -f install apt-get upgrade
根据网卡编号 编辑/etc/netplan/50-cloud-init.yaml 设置静态ip 我这里是ens33
network: ethernets: ens33: addresses: [192.168.3.244/24, ] dhcp4: no dhcp6: no gateway4: 192.168.3.1 nameservers: addresses: [8.8.8.8, 9.9.9.9] version: 2
立即生效
netplan apply