0


Ubuntu24.04 安装ssh开启22端口及允许root用户远程登录

1、安装openssh-server插件开启22端口访问

# 安装ssh会默认启动服务并开启22端口
apt update
apt install openssh-server

** 2、开启root用户远程访问**

  • 激活root用户,设置root用户登录密码
hunter@localhost:/$ sudo passwd root
New password: 
Retype new password: 
  • 修改配置

找到配置文件/etc/ssh/sshd_config,打开注释 #PermitRootLogin prohibit-password,并修改为

PermitRootLogin yes

hunter@hunter-SER:/$ cat /etc/ssh/sshd_config

......

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

......

3、重启 ssh 服务

service ssh restart
标签: ssh 服务器 运维

本文转载自: https://blog.csdn.net/qq_32944025/article/details/142436234
版权归原作者 Hunter4J 所有, 如有侵权,请联系我们删除。

“Ubuntu24.04 安装ssh开启22端口及允许root用户远程登录”的评论:

还没有评论