LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   change root password (https://www.linuxquestions.org/questions/linux-newbie-8/change-root-password-4175446160/)

kalidha 01-18-2013 05:08 AM

change root password
 
Hi,
Could someone tell me how to change the root password?
I tried using "passwd" but it did not work.
Thanks!

konsolebox 01-18-2013 05:26 AM

As root:
Code:

echo "root:<password>" | chpasswd

ukiuki 01-18-2013 05:28 AM

Here the basic syntax for passwd:
Code:

NAME
      passwd - change user password

SYNOPSIS
      passwd [options] [LOGIN]


For a more detailed info read the man for passwd
Code:

$ man passwd


Regards

shivaa 01-18-2013 06:37 AM

First thing is, you should be root to change root password. So switch to root user and then invoke:-
Code:

~$ passwd
OR
~$ passwd root

For NIS based system you should try:
Code:

~$ passwd -r nis <username>
OR
~$ yppasswd <username>

Also once go through manual page.

jschiwal 01-18-2013 06:38 AM

Which distro are you using? If it's Ubuntu or an Ubuntu derivative, the root account is disabled.


All times are GMT -5. The time now is 07:17 AM.