zoukankan      html  css  js  c++  java
  • Ubuntu 20.04 Install SSH, Change SSH Port, Enable root

    1. Install SSH service

    $ sudo apt install openssh-server
    $ systemctl status sshd
    $ sudo systemctl restart ssh
    $ sudo ufw allow ssh
    $ sudo systemctl enable ssh

    2.Change default SSH port 22 to some other port number above 1024. 

    To do so edit the /etc/ssh/sshd_config
    Port 8888

    $ sudo ufw allow 8888/tcp 

    $ sudo systemctl restart ssh

    3. Enable root access SSH
    Open the /etc/ssh/sshd_config file with administrative privileges and change the following line:
    FROM:
    #PermitRootLogin prohibit-password
    TO:
    PermitRootLogin yes

    $ sudo systemctl restart ssh

    4. Enable root account

    By default the root's password is not set on Ubuntu 20.04 and the error message Permission denied, please try again will appear when attempting to SSH login as a root user. From this reason we need to set root's password. When prompted enter your current user password followed by new root password:
    $ sudo passwd
    [sudo] password for rusking:
    New password:
    Retype new password:
    passwd: password updated successfully

     5. Allow GUI root login on Ubuntu 20.04

    Edit the /etc/gdm3/custom.conf GDM configuration file to allow root login.

    add the AllowRoot=true line.

    Next, edit PAM authentication daemon configuration file /etc/pam.d/gdm-password and comment line which denies root access to graphical user interface.

    To do so edit file /etc/pam.d/gdm-password and put # in front of the line containing:
    auth required pam_succeed_if.so user != root quiet_success

    All done. Reboot your Ubuntu system.

  • 相关阅读:
    JAVA 设计模式 备忘录模式
    JAVA 设计模式 职责链模式
    JAVA 设计模式 中介者模式
    JAVA 设计模式 解释器模式
    JAVA 设计模式 观察者模式
    Linux下/usr/bin/python被删除的后果
    selenium 页面超时后捕获异常也无法继续get(url)使用的问题解决方案
    linux批量更改权限
    linux卸载软件
    安装pymysqlpool并使用(待补充)
  • 原文地址:https://www.cnblogs.com/rusking/p/13420060.html
Copyright © 2011-2022 走看看