# check version openssl version -a # backup sudo cp -R /usr/lib/ssl /usr/lib/ssl-1.1.1h # download latest version https://www.openssl.org/source/ wget https://www.openssl.org/source/openssl-1.1.1m.tar.gz # check wget https://www.openssl.org/source/openssl-1.1.1m.tar.gz.sha256 echo "$(cat openssl-1.1.1m.tar.gz.sha256) openssl-1.1.1m.tar.gz" | sha256sum --check # install sudo apt update && sudo apt install build-essential -y tar -zxvf openssl-1.1.1m.tar.gz cd openssl-1.1.1m ./config make sudo make install sudo mv /usr/bin/openssl /usr/bin/openssl-1.1.1f sudo ln -s /usr/local/bin/openssl /usr/bin/openssl sudo ldconfig # check current version openssl version -a # fix cert cd /usr/local/ssl sudo rmdir certs sudo ln -s /etc/ssl/certs sudo rmdir private/ sudo ln -s /etc/ssl/private sudo mv openssl.cnf openssl.cnf.original sudo ln -s /etc/ssl/openssl.cnf # check cert wget https://www.google.com
# display settings timedatectl # display timezone list timedatectl list-timezones # set timezone timedatectl set-timezone Asia/Shanghai
lsb_release -a
sudo vim /etc/hostname
$ visudo #添加 username ALL=(ALL) NOPASSWD:ALL
useradd
passwd
usermod
usermod -aG
userdel -r user
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication no
然后重启ssh服务
sudo service sshd restart
如果只是要禁止部分用户以密码登入ssh服务,则可以使用passwd命令中的锁定用户的密码,以user用户为例:
passwd -l user
sudo apt-get update
会失败, 以下处理可能解决问题sudo rm -rf /var/lib/apt/lists/* sudo apt-get update
/etc/update-motd.d/
下脚本动态生成的 /run/motd.dynamic
/usr/share/application
sudo vim /etc/default/grub
, 配置GRUB_DEFAULT=saved GRUB_SAVEDEFAULT=true
, 然后执行 sudo update-grub
, 就可实现启动的默认选项保存为上一次手动选择的结果。
timedatectl
来查看时间同步状态sudo timedatectl set-ntp no
sudo timedatectl set-ntp on
# 添加账户 useradd oak -s /bin/bash -m -l -G sudo # ssh 登录, /home/oak/.ssh/authorized_keys # visudo # 修改密码 passwd oak
# 安装 vino sudo apt-get install vino # 配置 vino gsettings set org.gnome.Vino enabled true gsettings set org.gnome.Vino require-encryption false gsettings set org.gnome.Vino prompt-enabled false gsettings set org.gnome.Vino view-only false gsettings set org.gnome.Vino authentication-methods "['vnc']" gsettings set org.gnome.Vino vnc-password $(echo -n "mypassword"|base64) # 启动 /usr/lib/vino/vino-server --display=:0
使用 vnc-viewer 客户端来连接
sudo apt install unattended-upgrades sudo dpkg-reconfigure -plow unattended-upgrades # select yes sudo vi /etc/apt/apt.conf.d/50unattended-upgrades # Unattended-Upgrade::Automatic-Reboot "true"; sudo unattended-upgrades --dry-run -d # test sudo unattended-upgrades -d # manual upgrade.