BitsFlowCloud香港VPS时间同步问题排查与解决

问题描述 在使用BitsFlowCloud香港VPS配置Google Authenticator二步验证时,始终提示验证码错误。经过反复测试,确认输入的动态验证码是正确的,但系统始终拒绝认证。 问题排查 1. 初步检查 首先检查了系统时间状态: $ timedatectl Local time: Thu 2025-02-13 15:02:45 CST Universal time: Thu 2025-02-13 07:02:45 UTC RTC time: Thu 2025-02-13 07:02:45 Time zone: Asia/Shanghai (CST, +0800) System clock synchronized: no NTP service: active 发现系统时间比实际时间快了约2分钟,且 System clock synchronized: no 表明NTP同步未成功。 2. 时间同步验证 尝试手动同步NTP: $ ntpdate -q pool.ntp.org Server 162.159.200.123: no server suitable for synchronization found 测试NTP端口连通性: $ nc -uvz pool.ntp.org 123 nc: connect to pool.ntp.org port 123 (udp) failed: Connection timed out UDP 123端口连接超时,确认NTP服务被上游封锁。 ...

2026-02-17 · 1 分钟 · 2189 字 · uuzp

🔐 Debian 从零配置 SSH 仅密钥登录(允许 root,禁用密码)

本文目标:让 SSH 进入“root 仅密钥可登录,密码彻底禁用”状态。 ⚠️ 建议保留一条已登录会话/控制台,避免误配置锁门。 ✅ 最终效果 只允许公钥:PubkeyAuthentication yes 禁用密码:PasswordAuthentication no root 仅密钥:PermitRootLogin prohibit-password 🔧 1. 确认 SSH 服务已安装并运行 apt update apt install -y openssh-server systemctl enable --now ssh 🔑 2. 本地生成密钥(已存在可跳过) Linux / macOS: ssh-keygen -t ed25519 -a 64 -C "root@debian" -f ~/.ssh/id_ed25519 Windows(PowerShell): ssh-keygen -t ed25519 -a 64 -C "root@debian" -f $env:USERPROFILE\.ssh\id_ed25519 📌 3. 把公钥写入 root 的 authorized_keys 如果你此刻能用 root 登录(比如初始密码/控制台),直接用 ssh-copy-id: ssh-copy-id -i ~/.ssh/id_ed25519.pub root@<服务器IP> Windows(PowerShell)可用下面这条等价命令: Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub | ssh root@<服务器IP> "umask 077; mkdir -p /root/.ssh; cat >> /root/.ssh/authorized_keys" 不方便 ssh-copy-id 就手工写(在服务器上执行): ...

2025-12-23 · 1 分钟 · 1615 字 · uuzp