ubuntu 24.04 linux 初始安装及允许 ssh 外部连接
这次我买了一台迷你 PC。 我需要控制 Linux 内核,但认为在目前使用的服务器上操作存在安全风险,因此在 AliExpress 上新买了一台迷你 PC。 所以这篇文章以 Ubuntu 为基础编写,而不是 AlmaLinux。 允许 root 并启用 sshd 连接 关闭 ufw 防火墙 以文本模式启动 安装 doc
GGAMI
这次我买了一台迷你 PC。 我需要控制 Linux 内核,但认为在目前使用的服务器上操作存在安全风险,因此在 AliExpress 上新买了一台迷你 PC。 所以这篇文章以 Ubuntu 为基础编写,而不是 AlmaLinux。 允许 root 并启用 sshd 连接 关闭 ufw 防火墙 以文本模式启动 安装 doc
这次我买了一台迷你 PC。
我需要控制 Linux 内核,但认为在目前使用的服务器上操作存在安全风险,因此在 AliExpress 上新买了一台迷你 PC。
所以这篇文章以 Ubuntu 为基础编写,而不是 AlmaLinux。
passwd root
sudo -i
apt update
apt install vim
apt install openssh-server
vim /etc/ssh/sshd_config
Port
systemctl stop ufw
systemctl disable ufw
rebootsystemctl set-default multi-user.targetapt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl start docker
systemctl enable docker
docker run hello-worldcat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logolscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 48 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 12
On-line CPU(s) list: 0-11
Vendor ID: AuthenticAMD
BIOS Vendor ID: Advanced Micro Devices, Inc.
Model name: AMD Ryzen 5 6600H with Radeon Graphicsdocker network create backend
Error response from daemon: Failed to Setup IP tables: Unable to enable SKIP DNAT rule: (iptables failed: iptables --wait -t nat -I DOCKER -i br-2bbd93766d2a -j RETURN: iptables: No chain/target/match by that name.
(exit status 1))尝试创建 Docker 网络时,如果出现上述错误,是因为 iptables 中没有 docker network。
iptables -t nat -L -n -v
systemctl restart docker重启 Docker 即可。 (可能是因为某处正在使用 iptables -F 进行初始化而导致的。)