avatar

請勿斷片

演好各自的剧本

  • 首页
  • 导航
  • linux
  • 关于
Home ubuntu22开启root远程登录
文章

ubuntu22开启root远程登录

Posted 2023-11-20 Updated 2024-11- 22
By 789cn
3~4 min read

ubuntu18.04开启root远程登录

首先安装 OpenSSH Server
Installation

Installation of the OpenSSH client and server applications is simple. To install the OpenSSH client applications on your Ubuntu system, use this command at a terminal prompt:

sudo apt install openssh-client

To install the OpenSSH server application, and related support files, use this command at a terminal prompt:

sudo apt install openssh-server

在 Ubuntu 18.04 上,root 用户默认情况下是被禁用的,这是出于安全考虑。如果您需要在远程登录中使用 root 用户,可以按照以下步骤进行设置:

  1. 使用普通用户登录到 Ubuntu 18.04。

  2. 通过 sudo 命令切换到 root 用户,输入以下命令并按回车键:

    sudo -i
    
  3. 编辑 SSH 配置文件 /etc/ssh/sshd_config,使用以下命令打开文件:

    nano /etc/ssh/sshd_config
    
    
  4. 找到以下行并将其取消注释(去掉行首的“#”符号):

    #PermitRootLogin prohibit-password
    

    修改为:

    PermitRootLogin yes
    
  5. 保存并关闭文件,然后重启 sshd 服务,使用以下命令:

    systemctl restart sshd
    
    
  6. 现在您可以使用 root 用户通过 SSH 远程登录到 Ubuntu 18.04。

请注意,开启 root 用户的远程登录可能会增加系统的安全风险。建议使用普通用户登录系统并使用 sudo 命令进行管理操作,这样可以更好地保护系统的安全性。

🚀Linux
linux Ubuntu 信息互联
License:  CC BY 4.0
Share

Further Reading

Jan 18, 2024

Windows___定时备份___自动备份文件夹

bat方式适合设置开机启动 VBScript方式适合

Nov 30, 2023

Ubuntu_22.04.3_LTS_安装docker_

Ubuntu 22.04.3 LTS 安装docker 使用 apt 存储库安装 1、设置 Docker 的存储库。apt # Add Docker's official GP

Nov 20, 2023

ubuntu22开启root远程登录

ubuntu18.04开启root远程登录 首先安装 OpenSSH Server Installation Installation of the OpenSSH client and server applications is simple. To install the OpenSSH cl

OLDER

Ubuntu22.04_笔记

NEWER

Ubuntu_22.04.3_LTS_安装docker_

Recently Updated

  • 快速切换 本地电脑IP
  • Windows___定时备份___自动备份文件夹
  • Ubuntu_22.04.3_LTS_安装docker_
  • ubuntu22开启root远程登录
  • Ubuntu22.04_笔记

Trending Tags

Halo linux Centos 备份 windows Ubuntu 信息互联 姿势

Contents

©2025 請勿斷片. Some rights reserved.

Using the Halo theme Chirpy