修改root密码
登录普通用户使用命令修改root用户的登录口令:
sudo passwd root
配置静态网络
修改配置文件/etc/netplan/00-installer-ocnfig.yaml
:
# This is the network config written by 'subiquity'
network:
ethernets:
ens33:
dhcp4: false
addresses:
- 192.168.137.100/24
routes:
- to: default
via: 192.168.137.2
nameservers:
addresses: [8.8.8.8]
version: 2
使修改生效:
netplan apply
允许root用户远程登录
修改sshd配置文件/etc/ssh/sshd_config
,增加配置项:
PermitRootLogin yes
重启sshd服务:
systemctl restart sshd
配置命令别名
在/etc/profile
文件中追加以下内容:
alias 'l=ls -hlst'
alias 'grep=grep --color=auto'
alias 'vi=vim'
vim配置
创建~/.vimrc
文件,并添加内容:
set nu
set rnu
set hlsearch
禁用cloud-init
systemctl disable cloud-init-local cloud-init cloud-config cloud-final
systemctl stop cloud-init-local cloud-init cloud-config cloud-final