我有一个只有 root 用户的云服务器。我仅使用 RSA 密钥通过 SSH 连接到它。为了使它更安全,我想禁用密码功能。我知道这可以通过编辑/etc/ssh/sshd_config文件并更改PermitRootLogin yes为PermitRootLogin without-password. 我想知道是否简单地删除 root 密码 viapasswd -d root将是等效的(假设我没有创建更多用户或新用户也删除了他们的密码)。一种方法与另一种方法相比是否存在任何安全问题?
/etc/ssh/sshd_config
PermitRootLogin yes
PermitRootLogin without-password
passwd -d root
security linux ubuntu ssh rsa
linux ×1
rsa ×1
security ×1
ssh ×1
ubuntu ×1