How to change the root password and retrieve the password in Linux

Source: Internet
Author: User

Log in as root and execute:

# Passwd User Name (Change Password)

# Useradd User Name (Add User)

Example: [root @ bogon ~] # Passwd root

Changing password for user root.

New UNIX password:

Bad password: it is based on a dictionary word

Retype new UNIX password:

Passwd: all authentication tokens updated successfully.

How to retrieve the root password in linux

========================================================== ==========================================

Linux root has the highest power. Once the root password is forgotten or stolen, it is a headache. How can I retrieve the root password? I will summarize it as follows:

(1) Linux system password cracking

1. Press e in the grub option menu to enter the editing mode.

2. Edit the line/init 1 (or/single) of the kernel)

3. Press B to restart

4. Run the following command

Root @ # passwd root (configure the root password)

Enter new unix password: Enter a new password

Root @ # init 6

========================================================== ==========================================

(2) debian linux system password cracking

1. In the grub option menu 'debian GNU/Linux,... (recovery mode) ', press e to enter the editing mode.

2. Edit the ro single line in the kernel to rw single init =/bin/bash, and press B to restart.

3. Run the following command

Root @ (none) # mount-

Root @ (none) # passwd root

Root @ (none) # reboot

========================================================== ==========================================

(3) Freebsd system password cracking

1. boot to enter the boot menu

2. Select each item (Press 4) to enter the single-user mode.

3. Enter a command column.

Root @ # mount-

Root @ # fsck-y

Root @ # passwd (password change command)

 

:

Related Article

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.