• Ubuntu 20.04 Server Enable root User Account


    初始设置:启用root用户帐户

    The root Account in Ubuntu is disabled by default because his password is not set. To use root priviledges, basically it's better to use the sudo command with administrative accounts. But if you'd like to use root Account itself by some reason, it's possible to use like follows.

    默认情况下,Ubuntu中的root账户是禁用的,因为未设置其密码。要想使用root特权,最好是将sudo命令与管理账户一起使用。但是,如果出于某种原因想要使用root帐户本身,则可以像下面这样使用

    The user account added during installation is set an administrative account with sudo, so it's easy to get root account's shell like follows.

    ubuntu@dlp:~$ sudo -s
    [sudo] password for ubuntu:   # input self password
    root@dlp:/home/ubuntu#        # just switched
    

    Or it's possible to switch to root account with standard su command to set root account's password.

    或者可以使用标准su命令切换到root帐户来设置root帐户的密码

    ubuntu@dlp:~$ sudo passwd root
    [sudo] password for ubuntu:   # input self password
    New password:                 # set root password
    Retype new password:          # confirm
    passwd: password updated successfully
    
    ubuntu@dlp:~$ su -
    Password:                     # input root password
    root@dlp:~#                   # just switched
    

    The examples on this site shows by root user account. If you use sudo, add [sudo] on the head of commands.

    It's better to restrict users who can [su] to root if you enable root account like follows. For using by sudo, it's possible to limit to prohibit shells in sudoers config, refer to details about sudo Settings.

    For [su] command restriction, set like follows.

    root@dlp:~# vi /etc/pam.d/su
    # line 15: uncomment and add a group which is allow to run [su] command
    auth       required   pam_wheel.so  group=adm
    
    # add a user you allowed to run [su] to the group you set above
    # 将您允许运行[su]的用户添加到上面设置的组中
    root@dlp:~# usermod -G adm ubuntu
    
  • 相关阅读:
    GPU上的随机森林:比Apache Spark快2000倍
    基于TensorFlow2.x的实时多人二维姿势估计
    用code2vec、glow和spaCy进行词嵌入
    如何进行数据科学竞赛?(EDA)
    Python性能分析技巧
    PyTorch中基于TPU的FastAI多类图像分类
    GitHub上的AutoML
    Keras vs PyTorch vs Caffe:CNN实现对比
    深度学习的学习率调节实践
    win7下MariaDB10.0的my.ini配置文件的位置
  • 原文地址:https://www.cnblogs.com/PrimerPlus/p/13285803.html
Copyright © 2020-2023  润新知