1、系统修改IP地址

root@ubuntuserver:~# cat /etc/netplan/00-installer-config.yaml

# This is the network config written by 'subiquity'

network:

 version: 2

 ethernets:

   ens33:

    addresses: [192.168.0.118/24]

    gateway4: 192.168.0.1

    dhcp4: no

    nameservers:

     addresses: [202.96.134.133,202.96.128.68]


2、更新系统

sudo apt update

sudo apt upgrade


3、安装 ifconfig

sudo apt install net-tools


4、开启root用户登录

4.1. 给root账户设置密码

在当前普通用户界面下输入命令: sudo passwd root

然后按提示两次输入密码即可.


4.2. 修改sshd配置

sudo vi /etc/ssh/sshd_config

按i进入编辑模式,找到#PermitRootLogin prohibit-password,默认是注释掉的。直接在下面添加一行:PermitRootLogin yes,然后按esc,输入:wq,保存并退出。


4.3. 重启sshd服务

      sudo systemctl restart sshd