免密sudo
adduser username
vim /etc/sudoers
username ALL=(ALL) NOPASSWD: ALL
禁用root登陆
passwd -S root #查看
root L 06/03/2024 0 99999 7 -1
passwd -l root #禁用
修改服务器名
hostnamectl set-hostname newname
命令补全
vim /etc/inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
bind -f /etc/inputrc
vim
set paste
set number
# set invnumber 翻转set number设置
时区
timedatectl set-timezone Asia/Shanghai
温度监控
apt install lm-sensors
modprobe drivetemp
sensors
被执行脚本绝对路径
script_dir=$(dirname $(readlink -f $0))
发表回复