Modify root username on Linux

Source: Internet
Author: User
Tags generator

<title>Modify root username on Linux</title> Modify root username on Linux

If the user name we want to modify is Root_test
Two methods:

    1. Modify/etc/passwd/etc/shadow/etc/group
      Change the root of the inside into root_test.
      Should not be a safe practice
    2. Add a new user with UID 0
      Useradd-o-U 0-g root-m
      -M,--no-create-home-o,--non-unique allow to              create users with Duplicate (Non-unique) uid-g,--gid GROUP               name or ID of the primary group of the new account

      passwd Root_test # If you don't give him the code, it's tragic, of course. Sudo permissions can be used

      Vi/etc/sudoers

      Root        all= (All)   allroot_test   all= (All)   all

      Modify the login shell for/etc/passwd
      /bin/bash ==>/sbin/nologin Disable Login to the original root login

      It's like this on the Fedora system.

      Root:x:0:0:root:/root:/sbin/nologin

Modify root username on Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.