change forgotten root password in debian squeeze

You have to change to file 

nano /etc/shadow

after that you will get something like this


It will look like this

delete all between first and second colons. Then save it.

There after edit another file

nano /etc/pam.d/gdm3

In this file comment 5th line.

auth    requisite
auth    required readenv=1
auth    required readenv=1 envfile=/etc/default/locale
#auth    required user != root quiet_success
@include common-auth
auth    optional
@include common-account
session required
@include common-session
session optional auto_start
@include common-password

Save and reboot your machine. now you can able to login as root without password.

Set your password with following command
root@localhost:~#passwd root


1 Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s