# 编辑配置文件
root@localhost:~# vi /etc/resolvconf/resolv.conf.d/tail
# 添加以下内容
nameserver 8.8.8.8
nameserver 8.8.4.4
# 编辑配置文件
root@localhost:~# vi /etc/network/interfaces
# 添加或修改以下内容
auto eth0
iface eth0 inet static
address 172.16.1.2
netmask 255.255.0.0
gateway 172.16.1.1
root@localhost:~# ssh-keygen -y -f id_rsa > id_rsa.pub
# 添加启动脚本
root@localhost:~# update-rc.d /etc/init.d/rtsock defaults 90
# 删除启动脚本
root@localhost:~# update-rc.d -f rtsock remove
# 查看root用户的所有进程
root@localhost:~# top -u root
root@localhost:~# ps axu | grep name
# 修改用户名称ismail修改为ali
root@localhost:~# usermod -l ali ismail
# 变更用户的uid
root@localhost:~# usermod -u 1010 ismail
# 修改家目录
root@localhost:~# usermod -d /home/susan -m susan
# 修改用户组名dan修改为susan
root@localhost:~# groupmod -n susan dan
# 变更组gid
root@localhost:~# groupmod -g 1000 susan
# 显示系统信息
root@localhost:~# uname -a
# 显示当前内核
root@localhost:~# uname -r
# 显示已安装内核
root@localhost:~# dpkg --get-selections |grep linux-image
# 删除多余内核
root@localhost:~# apt-get --purge remove linux-image-4.19.0-16--amd64
# 更新 grub 移除失效的启动项
root@localhost:~# update-grub
root@localhost:~# update-grub2
# 删除旧软件包缓存
root@localhost:~# apt-get autoclean
# 删除所有软件包缓存
root@localhost:~# apt-get clean
# 卸载不再依赖孤立软件
root@localhost:~# apt-get autoremove
# 清理系统残留配置
root@localhost:~# dpkg -l |grep "^rc"|awk '{print $2}'|xargs apt -y purge
# 设置系统语言
root@localhost:~# dpkg-reconfigure locales
# 设置时区
root@localhost:~# dpkg-reconfigure tzdata
# 重新生成SSH服务器端密钥方法
root@localhost:~# rm /etc/ssh/ssh_host_*
root@localhost:~# dpkg-reconfigure openssh-server