Skip to content

Ubuntu OS init

当前 team 主要使用 ubuntu 系统 + docker(rootless) 进行运维开发环境的维护。

Step1: 登录服务器, 配置 ssh key,配置 sudo

Terminal window
sudo useradd -m -k /etc/skel/ -s /bin/bash ubuntu

使用 adb host key 获取全量成员的 ssh key, 并配置到服务器上。

Step2: 配置 .config

从git 仓库中拉取 .config 文件,配置到服务器上。

Terminal window
git clone https://github.com/airdb/.config ~/.config

step3: docker 安装

增加 system 端口配置, 将一下内容添加到 /etc/sysctl.conf (/etc/sysctl.d/99-sysctl.conf) 文件中

pv4.ip_unprivileged_port_start=80
pv4.ip_unprivileged_port_start=443

Ubuntu FAQ

1. 更新证书链问题

Terminal window
apt list --installed | grep ca-certificates
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --reinstall ca-certificates

2. ssh 无法登录问题

通常文件或者目录权限导致,可以执行以下命令修复

Terminal window
chown -R ubuntu:ubuntu ~/.ssh
chmod 700 ~/.ssh
chmod 644 ~/.ssh/authorized_keys