君相见的博客

  • 博客首页
  • 软件应用
  • 操作系统
  • 经验分享
  • 数据存储
  • 网络相关
  • 虚拟化
  • 在线视频
  • 新闻内容
  1. 首页
  2. 经验分享
  3. 正文

debian13配置root远程登录

2026年4月14日 16点热度 0人点赞 0条评论

Debian 系统(特别是 Debian 12/13 版本)出于安全考虑默认开启的机制,禁止 root 用户通过 SSH 使用密码登录。
要解决这个问题,你需要修改 SSH 配置文件。由于你现在应该能通过控制台(VNC)或本地终端操作,请按照以下步骤操作:
🛠️ 一键修复(推荐)
你可以直接复制下面的命令块,在终端中一次性执行。它会自动修改配置、开启密码认证并重启服务。

# 1. 修改配置:允许 root 登录
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# 如果上面那行没生效(有些版本默认是注释掉的),强制追加一行确保生效
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config

# 2. 确保允许密码认证
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config

# 3. 重启 SSH 服务
systemctl restart ssh
标签: 暂无
最后更新:2026年4月14日

君相见

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2018 君相见的博客. ALL RIGHTS RESERVED.

51LA

Theme Kratos Made By Seaton Jiang