linux系统刚安装完成后,ssh服务默认禁止root用户登录远程,需在配置文件 /etc/ssh/sshd_config中开启认证设置
PermitRootLogin yes #允许root认证登录
PasswordAuthentication yes #允许密码认证
直接命令行执行命令即可
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
service sshd restart
或者执行
sed -i -e 's/^PermitRootLogin.*$/PermitRootLogin yes/' /etc/ssh/sshd_config
sed -i -e 's/^PasswordAuthentication.*$/PasswordAuthentication yes/' /etc/ssh/sshd_config
service sshd restart
Linux系统刚安装完,SSH服务默认禁止root用户远程登录。可在配置文件 /etc/ssh/sshd_config 中开启认证设置,也可直接在命令行执行相关命令来实现。
1788

被折叠的 条评论
为什么被折叠?



