-   Linux - General (
-   -   Change the root password (

thirstonlinux 02-16-2013 07:47 PM

Change the root password
I logged in as root. but when i try to change the password using passwd command nothing happens.
when i check the return value using echo $? it returns 1.
help me

John VV 02-17-2013 12:32 PM

without knowing the distro you are using ...

for example
if this it Ubuntu 12.10 there is NO root password ( just your normal user's )
if fedoea 18
-- the logging in as root --- bit will require the pam hack ,IF by "logging in" you mean to the GUI -- Gnome3
And that will cause problems

see :

passwd --help
--- and ---
man passwd

to quote the manual page

Password Changes
If an old password is present, the user is first promted for it and
the password is compared agaisnt the stored one. This can be changed,
depending which PAM modules are used. An administrator is permitted
to bypass this step so that forgotten passwords may be changed.

After the user is authenticated, password aging information are
checked to see if the user is permitted to change their password at
this time. Else passwd refuses to change the password.

The user is then prompted for a replacement password. Care must be
taken to not include special control characters or characters, which
are not available on all keyboards.

If the password is accepted, passwd will prompt again and compare the
second entry against the first. Both entries are require to match in
order for the password to be changed.

All times are GMT -5. The time now is 11:23 AM.