首先,让我们看看sshd_config中有关PermitRootLogin的配置信息。
# greppermitrootlogin/etc/ssh/sshd _ config
permitrootlogin是
# thesettingof ' permitrootloginwithout-password '
那么,permitrootloginwithout-password是什么意思?
PermitRootLogin设置项有哪些设置参数?
常见:是,否
陌生人: without-password,forced-commands-only,
PermitRootLogin配置详细信息:
specifieswhetherrootcanloginusingssh (1).the argument must be“是”
“without-password”,“forced-commands-only”,or“no”. thedefaultis“yes”。
ifthisoptionissetto“without-password”,passwordauthenticationisdisabledforroot。
ifthisoptionissetto“只限前向命令”,rootloginwithpublickeyauthentication
will be allowed,butonlyifthecommandoptionhasbeenspecified (whichmaybeusefulfor
takingremotebackupsevenifrootloginisnormallynotallowed ).All other authentica‐
tion methods are disabled for root。
If this option is set to “no”,root is not allowed to log in。
大致意思:
如果未设置PermitRootLogin,则默认值为yes,即root可以登录
设置without-password后,root可以登录,但不允许使用密码ssh登录
如果设置为no,则root无法登录
如果设置为forced-commands-only,则可以登录,但登录后不能进入交互。 执行指定的命令时自动结束。
现在很清楚了