Operating System - Linux
1823113 Members
3303 Online
109646 Solutions
New Discussion юеВ

Re: how to recover admin password for console.

 
SOLVED
Go to solution
bharani123
Occasional Advisor

how to recover admin password for console.

is there is any way for recovering console password for admin.

Thanks in advance...
5 REPLIES 5
Jeeshan
Honored Contributor
Solution

Re: how to recover admin password for console.

reset the console
a warrior never quits
Mike (Sinew)
Occasional Advisor

Re: how to recover admin password for console.

Reset the server and add "init=/bin/sh" to the boot loader (assuming lilo does not have a "password" option or you know that password). When the kernel has booted, the init is replaced with a shell. Do "mount -o remount,rw /" and change the password of the root user with "passwd". Do "sync" and "mount -o remount,ro /". Reboot the server and login with the new password. Note that there is no way to determine what the password was, since the password is stored using a hash. This procedure just changes the root password to a new one.
Omne animal triste post coitum
Steven E. Protter
Exalted Contributor

Re: how to recover admin password for console.

Shalom,

No admin user in Unix/Linux. Its called root.

boot the system with power switch into single user mode. Then passwd command.

The procedure for booting into single user mode varies from distribution to distribution.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Mike (Sinew)
Occasional Advisor

Re: how to recover admin password for console.

Steven, single user mode (either init 1 or S) will still ask the password for the root user (at least on SuSE Linux). I presume it's no different on other distributions. So, to bypass this, the init has to be changed to a shell.

By the way, another method is to boot a rescue system, mount "/" on some directory (like "/mnt"), do a "chroot /mnt", "passwd" to change the root's password, "logout" and "unmount /mnt". After a reboot, the root user can login with the new password.
Omne animal triste post coitum
Don Vanco - Linux Ninja
Regular Advisor

Re: how to recover admin password for console.

There kernel is the kernel regardless of distro - get in your bootloader and append "single" or "s" or "S" to the kernel line and you'll boot to single user mode.

AFAIK only SuSE continues the stupidity of requiring the root password in single user mode, but then I'm not one to try the distro flavor of the week. If you have console access to _get_ into single user mode, you've compromised the system. Forcing the root pw is just more of an inconvenience than a real security "feature".

If you want to get real complex you can use one of several utilities to generate a new password hash, then boot with any of several "live" distros, mount /, and re-write /etc/shadow.... Never tried it myself as that's clearly a way to really mess a system that requires a pw in any init level. Obviously it would behoove one to copy the file before making any such edit....