Changing password via a script

Last update on August 4, 2009 01:32 PM by jak58
Published by jak58

Changing password via a script





Method 1: passwd


Conventionally the command use to change password on Linux based system is passwd
, the option related to this command is –stdin ,an this is all done throughout a pipe.

echo -e "new_password\nnew_password" | (passwd --stdin $USER)

Method 2: chpasswd


Another alternative is to use the chpasswd, explain as below:

echo "password:name" | chpasswd


Note that the first method can be use to change psssword on Samba based system:
echo -e "new_password\nnew_password" | (smbpasswd -a -s $USER) 
Best answers for « Changing password via a script » in :
How to change password in WLM/MSN ShowHow to change password under WLM/MSN To change your password Windows Live Messenger, simply use the interface provided for this purpose: https://accountservices.passport.net/ppnetworkhome.srf?vv=650&lc=1033 To do it...
How to change or recover your Windows Live Messenger password ShowHow to change or recover your Windows Live Messenger password 1.Changing your password (Windows Live Messenger) 2. Password Recovery Secret question Send password reset instructions to your alternative email address Download MSN Messenger...
Facebook – How to change your password? ShowFacebook – How to change your password? Issue Solution Issue Most users on the forum are unable or don’t know how to change their facebook account password! I have created this tip to help them changing their password if they are...
Download Change Forgotten Password Lite ShowWhen you use several and different passwords for each application, especially for messaging accounts, you must forget some. As its name suggests, Change Forgotten Password Lite is a tool to change a password whose content has been forgotten. It...
Download Change Forgotten Password Lite ShowWhen you use several passwords for each application that you use, especially for messaging account, you must forget some of them. As its name suggests, Change Forgotten Password Lite is a tool for changing a forgotten password. It runs on several...
User management in Windows NT ShowThe notion of a user Windows NT is an operating system which manages sessions, meaning that when the system is started, it is necessary to log in with a user name and password. When Windows NT is installed, the administrator account is created by...