Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Repair of root password in various UNIX systems

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

The method of forgetting solaris root password

1. If you can still log in as an ordinary user,% df / etc, determine the name of the device that contains the partition of the / etc directory

% df / etc

/ / dev/dsk/c0t0d0s0...

In this case, c0t0d0s0. If your root partition device is different, you can replace it.

2. Insert the system disk into the cdrom

3. At the prompt, refresh the file system using the sync command

4, press stop+A

5, type boot cdrom-s in "ok" status

6, type mkdir / temp at the "#" prompt, and then type mount / dev/dsk/c0t0d0s0 / temp

If there is a hook-up failure, run fsck first fsck / dev/rdsk/c0t0d0s0, then in mount

7,cd / temp/etc

8,cp shadow shadowbak

9,cat shadow

Get the password string of root

Root:djglcj0J:6453:::: (where djglcj0J is the encrypted password string of root)

10 perfected s/djglcj0J// shadow > shadownew

11Cat shadownew to see if it has become

Root::6453::::

12,cp shadownew shadow

13,cd /

Unmount / temp

Sync

Shutdown-i0-G0-y

14. After taking out the CD, restart the system, and then the root does not need a password!

That's okay!

OK boot cdrom-s

# TERM=sun

# export TERM

# mount / dev/dsk/c0t0d0s0 / a

# vi / a/etc/shadow (delete the encrypted password of root)

# reboot

Second: restore the SCO UNIX super user password

Once the superuser password running the SCO UNIX machine has been forgotten, it can be solved in this way.

On another machine with SCO UNIX installed, register as a Root user, enter the system, and use the mkdev fd command or the Floppy Filesystem Manager of Filesystem in the command scoadmin to create an emergency boot disk, including Boottable disk and Root system disk.

Install the Root filesystem disk made above to the hard disk.

# mount / dev/fd0135ds18 / mnt

Then copy the / etc/passwd and / tcb/files/auth/r/root files on the hard drive to the Root system disk.

# cp / etc/passwd / mnt

# cp / tcb/files/auth/r/root / mnt

Uninstall the floppy disk from the hard drive of machine 1.

# umount / dev/rfd0135ds18

Use the Boot floppy disk to start the machine that forgot the password, insert the Root filesystem floppy disk according to the prompts, and when the "#" appears, do the following to attach the hard disk to the floppy disk:

# mount / dev/hd0root / mnt

Back up the / etc/passwd and / tcb/files/auth/r/root files on your hard drive. Because these two files also contain the registration information of other users.

Overwrite the two files / etc/passwd and / tcb/files/auth/r/root on the hard disk with two files on the Root filesystem floppy disk.

# mkdir / cyh

# mount / dev/fd0135ds18 / cyh

# cd / cyh

# cp passwd / mnt/etc

# cp root / mnt/tcb/files/auth

Unmount the two file systems on the installation.

# umount / dev/hd0root

# umount / dev/fd0135ds18

Take out the floppy disk, restart the machine, and when the Login appears, register as the Root user and type the superuser password of the second machine, so that you can enter the superuser.

After entering the superuser, overwrite the original file with the backup of Passwd and Root, and then use the passwd command to change the password of the superuser.

Users can exchange Alt+F2 for another window, register with Root, and now use the modified password.

Third: the root password of aix4.3.3 (ibm) rs/6000 is lost.

Put the first installation disk into the CD-ROM drive, restart the machine, press f5 and the terminal press 5 to enter the maintance page, select the function option of mount rootvg, call password to change the password, and exit.

Four: freebsd's root password is lost.

FreeBSD 4.7

When "boot... 9 seconds" is displayed, press any key

Enter: boot-s

After logging in

# / sbin/mount-a

# passwd

Five: retrieve the root password that linux forgot (lilo/grub)

There are three ways:

1. When the system enters the single user state, use passwd root to change it directly.

two。 Boot the system with the installation CD, perform linux rescue status, and attach the original / partition as follows:

Cd / mnt

Mkdir hd

Mount-t auto / dev/hdaX (original / partition number) hd

Cd hd

Chroot. /

Passwd root

This can be done.

3. Take off the hard drive of this machine and hang it on other linux systems in the same way as the second one

In rh8

one。 Lilo

1. Type linux single at the lilo: prompt

The screen shows lilo: linux single

two。 Enter can directly enter the linux command line

3. # vi / etc/shadow

Delete the first line, which begins with root, after root: and before the next:

The first line will be similar to

Root::.

Save

4. # reboot restart, root password is empty

two。 Grub

1. When the grub screen appears, use the up and down keys to select the item in which you normally start linux (do not select dos yo), and then press the e key

two。 Once again, use the up and down keys to select the item where you normally start linux (similar to kernel / boot/vmlinuz-2.4.18-14 ro root=LABEL=/), and then press the e key

3. Modify the command line you see now, add single, and the result is as follows:

Kernel / boot/vmlinuz-2.4.18-14 single ro root=LABEL=/

4. Enter and return, then press b to start, and you can directly enter the linux command line.

5. # vi / etc/shadow

Delete the first line, which begins with root, after root: and before the next:

The first line will be similar to

Root::.

Save

6. # reboot restart, root password is empty

6: the root password of HP-UX is lost:

Press esc to enter isl at startup

After entering ISL:

Isl > bo pri

(yes/no) y

Ipl > hpux-is

Ipl > vi / etc/passwd

By removing the password of root, the system administrator can set the security policy of the password through the configuration program. For example, you can launch the linuxconf utility as root to configure and change your account. If you forget the super user's password, you can only boot the system with Linux's boot disk, then find the Linux partition on the hard drive, and then edit the / etc/passwd file, where the encrypted password of the root user is deleted.

Assume that the entry for root in / etc/passwd is as follows:

Root:x:0:0:root:/root:/bin/bash

Where "x" is the result of password encryption, you should change it to the following form:

Root::0:0:root:/root:/bin/bash

Now, root does not have a password, so you can restart the machine, register with root at the registration prompt, and press the key when prompted for the password.

CUUG

For more oracle video tutorials, please click: http://crm2.qq.com/page/portalpage/wpa.php?uin=800060152&f=1&ty=1&aty=0&a=&from=6

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report