一键开启 root SSH 登录

一键命令(Debian 12)

20251227033033463212

# 1. 设置 root 密码(会提示输入新密码)
passwd root

# 2. 修改 SSH 配置允许 root 和密码登录
sed -i 's/^#\?PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config
sed -i 's/^#\?PasswordAuthentication .*/PasswordAuthentication yes/' /etc/ssh/sshd_config

# 3. 重启 SSH 服务生效
systemctl restart ssh

# 4. 显示提示信息
echo "✅ root SSH 登录已启用,可使用 root 密码通过第三方 SSH 客户端连接。"

再次使用第三方ssh客户端连接发现已经可以连上了。

20251227033125159877

 

 

© 版权声明
THE END
喜欢就支持一下吧
点赞12 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容