目录
1. ubuntu20.04
关闭防火墙
sudo ufw disable
sudo ufw status
关闭swap
swapoff -a
sed -i ‘/ swap / s/^(.*)$/#\1/g’ /etc/fstab
修改网卡文件
### vi /etc/netplan/01-network-manager-all.yaml
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
ethernets:
ens33:
dhcp4: no
dhcp6: no
addresses: [192.168.10.43/24]
optional: true
gateway: 192.168.10.2
nameservers:
addresses: [192.168.10.2],[114.114.114.114],[8.8.8.8]
### netplan apply
修改国内源
apt update
apt upgrade
apt -y install net-tools openssh-server vim
允许root ssh远程登录
# cp /etc/ssh/sshd_config /etc/ssh/ssh_config_backup
# vim /etc/ssh/sshd_config #允许root远程登录
PermitRootLogin yes
# systemctl restart sshd