ubuntu中ssh连接root用户

开启ssh服务

复制代码
#下载
sudo apt-get install openssh-server

#设为开机自启动
sudo systemctl enable ssh

配置ssh 远程root连接

复制代码
sudo nano /etc/ssh/sshd_config

修改

1.去掉Port 22 前面的注释 #

2.去掉 ListenAddress 0.0.0.0 前面的#

3.去掉PermitRootLogin prohibit-password 前面的#

修改为

PermitRootLogin yes

4.去掉PasswordAuthentication yes前面的#

重启SSH服务

修改配置后,需要重启SSH服务以使更改生效。

复制代码
sudo systemctl restart sshd

如果还是失败可能是root没有设置密码

复制代码
sudo passwd root
相关推荐
未济17 小时前
linux 配置环境变量
linux
傲世仙尊17 小时前
目录即文件-Ext文件系统收尾篇
linux·c语言
_艾伦 耶格尔.18 小时前
进程间通信
linux
Liuqy-0519 小时前
Linux IO编程——静态库、动态库
linux
彧azz19 小时前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
-梅20 小时前
linux(8) 软硬链接
linux·运维·服务器
AIgorithmGEEK20 小时前
[Linux]线程三部曲(上):一个执行流的诞生——从操作系统一路拆到 pthread_create
linux·线程·pid
琥珀色糖21 小时前
SimlpeHttp
linux·服务器
qeen8721 小时前
【Linux】操作系统之进程介绍(二)
linux·笔记·学习·进程
Zenova EdgeOS21 小时前
Linux ss 工业边缘网络分析实战
linux·python·边缘计算·工业网关