> ## Content Index
> Fetch the complete content index at: https://blog.k3s.9zf.net/llms.txt
> Use this file to discover other available public pages before exploring further.

# debian12 ssh开启root远程登录
- URL: https://blog.k3s.9zf.net/debian12-ssh-e5-bc-80-e5-90-afroot-e8-bf-9c-e7-a8-8b-e7-99-bb-e5-bd-95/
- Published: 2024-05-27T03:49:42.000Z
- Updated: 2024-05-27T03:49:46.000Z
- Author: liu
- Tags: Uncategorized, #wordpress, #Import 2026-10-29 06:11

用过一次nano出现连不上的情况，vi反而正常。  
打开SSH配置文件/etc/ssh/sshd\_config并编辑该文件  
 vi /etc/ssh/sshd\_config  
  
查找并修改以下两行内容（如果不存在则添加）：  
 PermitRootLogin yes  
 PasswordAuthentication yes  
注：将PermitRootLogin设为”yes”表示允许通过SSH登录到Root账户；将PasswordAuthentication设为”yes”表示允许密码验证。  
  
保存更改后重新启动SSH服务：  
 systemctl restart ssh