https://www.ubuntu18.com/ssh-permitrootlogin/

SSH root login is disabled by default in Ubuntu 18.04.  SSH server for Ubuntu provides by the openssh-server package and root login is controlled by the PermitRootLogin directive in the OpenSSH server configuration (sshd_config file):

You can check the current status by running the following command:

grep -i "rootlogin" /etc/ssh/sshd_config

Root login is disabled, if the PermitRootLogin directive is commented out (# in front) or its value is not set to yes.

If you want to enable ssh root login, do the following steps with root privileges:

  1. Open the /etc/ssh/sshd_config:

    vim /etc/ssh/sshd_config
  2. Uncomment the line PermitRootLogin and set the value to yes:
    PermitRootLogin yes
  3. To make the new setting take effect, restart the ssh server:
    systemctl restart sshd.service

Now that we have enabled ssh root login, you can try ssh using the root user from a remote computer:

ssh root@192.168.1.100

Note that Ubuntu root account does not have a password by default. So if you want to log in to root ssh account, first you muse have set a password for the root user.

Allowing the root user to login over SSH is a not a good idea. we don't need to login as root to get root privileges. You can ssh to your Ubuntu server using a user who has sudo privileges, then switch to the root user account using sudo -i command.

Next: Change Ubuntu SSH Port

How to permit SSH root Login in Ubuntu 18.04的更多相关文章

  1. 转载:如何在Ubuntu 18.04上使用UFW设置防火墙

    https://blog.csdn.net/u013068789/article/details/82051943 介绍 UFW或Uncomplicated Firewall是iptables一个接口 ...

  2. Ubuntu 18.04 root 使用ssh密钥远程登陆

    前言: Ubuntu默认是禁止root用户远程登陆 本教程解决Ubuntu 18.04版本 root用户 使用ssh密钥无法远程登陆的问题 问题发生的环境: 腾讯云,重装Ubuntu服务器时选择使用s ...

  3. Ubuntu 18.04 启动root账号并授权远程登录

    Ubuntu 18.04 刚刚上市2个月,下载安装,尝尝鲜~ 安装界面看上去舒服许多, 安装的速度也较之前17.04 和16.04 都快了许多.抱歉,未截图. Ubuntu 安装完成后默认不启动roo ...

  4. Ubuntu 18.04系统中不能ssh外网远程

    前言 今天我不小心动了电插板,导致服务器断电,用远程命令开机,居然很长时间没反应,索性就亲自按电源键重启.服务器正常开机启动,ssh可以内网访问,远程命令内网有效果,就是外网不行.经过分析排查,是不是 ...

  5. 在Ubuntu 18.04 下安装mysql,没有初始密码,重设root密码

    在Ubuntu 18.04 下安装mysql 不知道是由于mysql更新为新版还是.Ubuntu18.04中的特性,安装过程中没有设置密码的环节,在网络上找了半天,总算解决了!特此记录下来,以便以后查 ...

  6. 如何在Ubuntu 18.04 LTS上安装和配置MongoDB

    MongoDB是一款非关系型数据库,提供高性能,高可用性和自动扩展企业数据库. MongoDB是一个非关系型数据库,因此您不能使用SQL(结构化查询语言)插入和检索数据,也不会将数据存储在MySQL或 ...

  7. Ubuntu 18.04 Server上安装LAMP

    由于要进行渗透测试,所以这两天就在搭LAMP的环境(过程及其痛苦) 这里分享一些我遇到的问题. 首先介绍一下我的使用环境  VM虚拟机,ubuntu 与主机NAT连接 由于之前一直使用的是kali(默 ...

  8. 如何在Ubuntu 18.04上安装Go

    如何在Ubuntu 18.04上安装Go 谢鸢发表于云计算教程系列订阅98 介绍 课程准备 第1步 - 安装Go 第2步 - 设置Go路径 第3步 - 测试您的安装 结论 介绍 Go是Google开发 ...

  9. How to install the NVIDIA drivers on Ubuntu 18.04 Bionic Beaver Linux

    Objective The objective is to install the NVIDIA drivers on Ubuntu 18.04 Bionic Beaver Linux. This a ...

随机推荐

  1. MATLAB 排序、拟合

    一.数据排序整合 1.随机生成的数,从小到大排序 clear rand('seed',1)%设置随机种子,确保随机数一样 edge_range=unifrnd (1, 10, 1, 10) edge_ ...

  2. 听说你还搞不定java中的==和equals?

    相信很多读者关于==和equals懂了又懵,懵了又懂,如此循环,事实上可能是因为看到的博客文章之类的太多了,长篇大论,加上一段时间的洗礼之后就迷路了.本篇文章再一次理清楚.当然如果觉得本文太啰嗦的话, ...

  3. 从 Socket 编程谈谈 IO 模型(三)

    快过年啦,估计很多朋友已在摸鱼的路上.而我为了兄弟们年后的追逐,却在苦苦寻觅.规划,导致文章更新晚了些,各位猿粉谅解. 上期分享,我们结合新春送祝福的场景,通过一坨坨的代码让 BIO.NIO 编程过程 ...

  4. pycharm文件名颜色代表的含义

    在使用pycharm过程中,文件名有不一样的颜色. 绿色:已经加入版本控制暂未提交 红色:未加入版本控制 蓝色:加入版本控制,已提交,有改动 白色:加入版本控制,已提交,无改动 灰色:版本控制已忽略文 ...

  5. 掌握使用gitlab ci构建Android包的正确方式

    最近公司在做移动端的项目,自然而然的需要搭建打包的环境.本来计划用Jenkins的,但是发现在gitlab上创建完项目后,提示去配置pipeline,于是决定用gitlab去尝试下,毕竟我觉得Jenk ...

  6. 1019 General Palindromic Number (20 分)

    A number that will be the same when it is written forwards or backwards is known as a Palindromic Nu ...

  7. iapp,iapp http请求,iapp解析json数据

    iapp发送http请求,并解析json数据 //http操作 t() { s a = "http://wap.baidu.com/" //目标url hs(a, null, nu ...

  8. JVM 理解性学习(二)

    1.G1 垃圾回收器 G1 能更少的 "Stop the World" ,能同时对新生代老年代进行垃圾回收. G1 将 Java 堆内存拆分为多个大小相等的 Region,并且新生 ...

  9. 电商平台--Mysql主从搭建(2)

    Master上授权从库: ```grant replication slave on *.* to slave1@ip identified by 'password';``` 基于数据库hotcop ...

  10. git 从另一个分支融合部分文件

    # git checkout master # git checkout anotherBranch -- abc ./etc # git commit -m "merge some fil ...