sshd
ssh 连接时卡一段时间
解决方法:修改服务器 sshd 配置文件 /etc/ssh/sshd_config,增加(或修改为)以下几项配置:
GSSAPIAuthentication no
UseDNS no
允许 root 直接登录
/etc/ssh/sshd_config
PasswordAuthentication yes
PermitRootLogin yes
或者用 PermitRootLogin without-password 只允许 root 用户以公钥验证方式登录。修改后需要重启 ssh 服务生效。
Oracle Cloud 等服务商的 VPS 创建时设置公钥会在 /root/.ssh/authorized_keys 里写入
no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"opc\" rather than the user \"root\".';echo;sleep 10" ssh-rsa ooxxxxxx55524242442……
将 "ssh-rsa" 前面的所有内容删掉(同时修改 sshd_config )即可正常以 root 登录。