首页 > 系统相关 >Ubuntu开启允许root用户访问ssh

Ubuntu开启允许root用户访问ssh

时间:2024-02-02 10:57:16浏览次数:29  
标签:sshd root etc ssh Ubuntu config

1、编辑 /etc/ssh/sshd_config 文件
vim /etc/ssh/sshd_config
2、设置允许roo登录

找到 PermitRootLogin 这个属性,默认是注释掉的,我们可以复制一行将其设置为 yes 即可。

设置完成后记得 :wq 保存文件哦。

image

3、重启ssh服务
systemctl restart  ssh

参考链接:https://cloud.tencent.com/developer/article/1496006

标签:sshd,root,etc,ssh,Ubuntu,config
From: https://www.cnblogs.com/Snowclod/p/18002729

相关文章

  • RHEL9 ssh RHEL6
    https://bugzilla.redhat.com/show_bug.cgi?id=2064740.ssh/configHostrhel6-hostKexAlgorithms+diffie-hellman-group14-sha1MACs+hmac-sha1HostKeyAlgorithms+ssh-rsaPubkeyAcceptedKeyTypes+ssh-rsaPubkeyAcceptedAlgorithms+ssh-rsa2./opt/openssl.cnf.include......
  • update for ubuntu software version
    1.addedkeywget-O-https://apt.kitware.com/keys/kitware-archive-latest.asc2>/dev/null|sudoapt-keyadd-2.addedrepositoryU20:sudoapt-add-repository-r'debhttps://apt.kitware.com/ubuntu/focalmain'U18:sudoapt-add-repository-r�......
  • Ubuntu开启22端口
    在Ubuntu中,开启22端口通常是为了远程连接设备或服务器。在本文中,我们将讨论如何在Ubuntu上开启22端口,并保持安全性。以下是开启22端口的步骤和一些有关远程连接的安全建议。一、安装SSH(SecureShell)要开启22端口,我们需要使用SSH协议。SSH提供了安全的远程连接,它通过加密通信来保......
  • 执行./ch-mount.sh -m rootfs/时报错: /bin/bash^M 解释器错误: 没有那个文件或目录
    执行./ch-mount.sh-mrootfs/时报错:/bin/bash^M解释器错误:没有那个文件或目录原因是./ch-mount.sh这个文件在Windows下编辑过,在Windows下每一行结尾是\n\r,而Linux下则是\n,所以才会有多出来的\r。 解决办法:先执行下面的命令sed-i's/\r$//' ch-mount.sh该指令会把......
  • Hive连接报错:root is not allowed to impersonate root (state=08S01,code=0)
    问题描述使用hive/bin目录下的hive启动客户端,使用!connectjdbc:hive2://hadoop01:10000连接Hive数据仓库时提示输入用户名和密码,输入数据库的用户名和密码报错:Error:CouldnotopenclienttransportwithJDBCUri:jdbc:hive2://hadoop01:10000:Failedtoopennewsession......
  • mac下通过ssh脚本实现免账号密码连接运服务器
    mac脚本连接服务器编辑脚本viXXX.ssh#spawn启动一个子进程spawnsshroot@IP-pPORT#expect当出现password:字样时expect"password:"#send向子进程发送密码send"PASSWORD"#控制权交还给用户interact使用脚本expectXXX.ssh......
  • Ubuntu安装docker
    aptupdateaptinstallapt-transport-httpsca-certificatescurlsoftware-properties-common添加Docker官方的GPG密钥:curl-fsSLhttps://download.docker.com/linux/ubuntu/gpg|sudogpg--dearmor-o/usr/share/keyrings/docker-archive-keyring.gpg添加Docke......
  • centos7升级openssh到9.0
    一、安装telnet作为备份连接用yuminstalltelnet-servertelnetxinetd二、启动telnet服务systemctlstarttelnet.socketsystemctlstartxinetdsystemctlstatustelnet.socketsystemctlstatusxinetd三、修改配置vim/etc/pam.d/remote注释掉这行#auth......
  • ssh: connect to host github.com port 22: Connection timed out
    ssh:connecttohostgithub.comport22:Connectiontimedout本地pull/push推送代码到github.com项目报错22端口超时,测试连接也是超时,如下图: 因为已经开强了,所以网络是通的,Google也正常访问怀疑是ssh秘钥问题,发现官方文档有相关介绍,按着操作解决。官方文档放在最后。......
  • ubuntu20嵌入式开发环境搭建
    vmware安装ubuntu20安装步骤:省略。网上有很多教程,不做笔记了。值得注意的一点:安装时先选择中文安装,会默认带有中文输入法。更换源首先输入下面的命令,备份原来的,以免出问题无法恢复。sudocp/etc/apt/sources.list/etc/apt/sources.list.bak使用vim编辑器打开,删掉里面的......