ubuntu开启 远程登录 允许root远程登录

如果没有22端口服务
sudo apt update
sudo apt install openssh-server
sudo ufw allow.ssh
sudo passwd root

修改配置文件

sudo vim /etc/ssh/sshd_config

Port 22 修改为 Port 22

#PermitRootLogin prohibit-password 修改为 PermitRootLogin yes
service ssh restart

其他个性化设置 开启ssh密钥连方式
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2

开启密钥连接

#root登录后
ssh-keygen 联系按2个空格
cd /root/.ssh
cat id_rsa.pub > authorized_keys

下载id_rsa文件到 桌面 选择root用户

加id_rsa验证登录 登录成功

相关推荐

  1. ubuntu开启 远程登录 允许root远程登录

    2024-07-23 08:26:06       16 阅读
  2. debian或Ubuntu开启ssh允许root远程ssh登录的方法

    2024-07-23 08:26:06       24 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-23 08:26:06       52 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-23 08:26:06       54 阅读
  3. 在Django里面运行非项目文件

    2024-07-23 08:26:06       45 阅读
  4. Python语言-面向对象

    2024-07-23 08:26:06       55 阅读

热门阅读

  1. P1725 琪露诺 题解

    2024-07-23 08:26:06       18 阅读
  2. Qt 实战(7)元对象系统 | 7.6、Q_DECLARE_METATYPE详解

    2024-07-23 08:26:06       15 阅读
  3. php 根据位置的经纬度计算距离

    2024-07-23 08:26:06       14 阅读
  4. 【git】切换到远程其他分支

    2024-07-23 08:26:06       15 阅读
  5. CentOS 6.8 中部署 Spring Boot 应用程序

    2024-07-23 08:26:06       16 阅读
  6. Mybatis-plus常用注解

    2024-07-23 08:26:06       15 阅读
  7. 华为OD机试 - 文件缓存系统——优先队列解法

    2024-07-23 08:26:06       19 阅读
  8. 计算机网络之数据链路层

    2024-07-23 08:26:06       15 阅读
  9. 今天是闭包,装饰器和案例

    2024-07-23 08:26:06       18 阅读