how to retrieve root paswd

Thread Tools Search this Thread
Special Forums Cybersecurity how to retrieve root paswd
# 1  
Old 08-22-2001
Question how to retrieve root paswd


I am a newcomer in the world of unix......i want to know if by smhow smone forget the root passwd is there any way to get it back....login as a odd user other than root..

please give suggession....

Thanks and regards.
# 2  
Old 08-22-2001
Well, assuming you're doing it lawfully, you should have access to the machine. If you are running Linux, head on over to and grab tomsrtbt to boot into your system from a floppy. If you are running some other hardware/software combination than Linux on Intel, check your documentation for details on booting into mini-root. Mount the partition / disk that contains the /etc directory, and you'll have to edit the passwd (or shadow, if you're using shadowed passwords) file. Clear out the password field for root, so it should look like this:

instead of
[Note: that is a munged passwd - don't waste your time trying to crack it. I just made it up. A normal password field would have 13 characters, and MD5 passwords have many more.]

Now, boot the system normally. You should be able to log in as root (or use su - ) without a password. Now make sure to set a good, rememberable (no, I don't think that's a work either) password!

You can also delegate root privelages to other accounts by editing the passwd file, but that's not always a good idea - especially on a production system.


# 3  
Old 08-22-2001
Thanks HTH..

I will try with this......

# 4  
Old 08-22-2001
Well with Linux this could be even easier:

at LILO prompt (or boot prompt) :
type linux -s or linux 1 or linux single

This will drop you into a root shell without asking a password.

When the bash# prompt appears, enter:

This will prompt you for a new root password, without asking the old one!

# 5  
Old 08-28-2001
Question How do I restrict leve 1?

I've had a problem in the past of a user coming into the office, rebooting the server and booting in single user mode and then changing the passwd.

How do I restrict booting into single user mode?

Thanks in advance.

# 6  
Old 08-29-2001

You _can_ stop people playing with your server totally, if you know how to do it... here are some instructions :

1)Disable all boot devices except harddisk in BIOS
2)Password BIOS
3)vi /etc/lilo.conf

add 'restricted=' option (look at man lilo.conf for more details)
add 'password=' option (again its in the man pages)

run lilo to apply changes

essentially you can restrict command line input (hence getting round the linux single problem, and you can also password the command the user wants to run (hence you can still do single if you know the password) Just make sure the default image is still bootable without user input, otherwise if it gets rebooted it'll stop at lilo.

Be careful with this, if the system screws and you cant get in you'll need to sort the BIOS and boot off floppy, then manually run lilo on the volume.

Any problems or further queries, drop me a mail
# 7  
Old 08-29-2001
thanks for the info.

I'm glad to get that information.


Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Can you gain root privileges if the suid program does not belong to root?

I had a question in my test which asked where suppose user B has a program with 's' bit set. Can user A run this program and gain root privileges in any way? I suppose not as the suid program run with privileges of owner and this program will run with B's privileges and not root. (1 Reply)
Discussion started by: syncmaster
1 Replies

2. Shell Programming and Scripting

Find users with root UID or GID or root home

I need to list users in /etc/passwd with root's GID or UID or /root as home directory If we have these entries in /etc/passwd root:x:0:0:root:/root:/bin/bash rootgooduser1:x:100:100::/home/gooduser1:/bin/bash baduser1:x:0:300::/home/baduser1:/bin/bash... (6 Replies)
Discussion started by: anil510
6 Replies

3. SuSE

Auditors want more security with root to root access via ssh keys

I access over 100 SUSE SLES servers as root from my admin server, via ssh sessions using ssh keys, so I don't have to enter a password. My SUSE Admin server is setup in the following manner: 1) Remote root access is turned off in the sshd_config file. 2) I am the only user of this admin... (6 Replies)
Discussion started by: dvbell
6 Replies

4. Solaris

Migration of system having UFS root FS with zones root to ZFS root FS

Hi All After downloading ZFS documentation from oracle site, I am able to successfully migrate UFS root FS without zones to ZFS root FS. But in case of UFS root file system with zones , I am successfully able to migrate global zone to zfs root file system but zone are still in UFS root file... (2 Replies)
Discussion started by: sb200
2 Replies

5. Solaris

Lost Root Password on VXVM Encapsulated Root Disk

Hi All Hope it's okay to post on this sub-forum, couldn't find a better place I've got a 480R running solaris 8 with veritas volume manager managing all filesystems, including an encapsulated root disk (I believe the root disk is encapsulated as one of the root mirror disks has an entry under... (1 Reply)
Discussion started by: sunnyd76
1 Replies

6. UNIX for Dummies Questions & Answers

How to allow access to some commands having root privleges to be run bu non root user

hi i am new to unix and i have abig task. i have to \run particular commands having root privileges from a non root user. i know sudo is one of the way but i need sum other approach kindly help Thanks (5 Replies)
Discussion started by: suryashikha
5 Replies

7. AIX

Can't login root account due to can't find root shell

Hi, yesterday, I changed root's shell in /etc/passwd, cause a mistake then I can not log in root account (can't find correct shell). I attempted to log in single-mode, however, it prompted for single-mode's password then I type root's password but still can not log in. I'm using AIX 5L version 5.2... (2 Replies)
Discussion started by: neikel
2 Replies

8. UNIX for Dummies Questions & Answers

I need it to prompt me for a root password, so I don't have to log as root

Hi folks, I'm trying to install a program, and I want to place some of the executables into /usr/bin so that they can be executed from any folder on the computer. I've been giveng the root password, but told never to log in directly as root. Instead, I can wait for a password prompt. However, I... (2 Replies)
Discussion started by: lunchtime
2 Replies

9. Linux

how to access root priveliges if root password is lost

wish to know how to access root password it root password is forgotten in linux (1 Reply)
Discussion started by: wojtyla
1 Replies

10. UNIX for Dummies Questions & Answers

Run non-root script as root with non-root environment

All, I want to run a non-root script as the root user with non-root environment variables with crontab. The non-root user would have environment variables for database access such as Oracle or Sybase. The root user does not have the Oracle or Sybase enviroment variables. I thought you could do... (2 Replies)
Discussion started by: bubba112557
2 Replies
Login or Register to Ask a Question