Command to change root password

Everybody knows passwd command but it’s useless when you need to change ex. root password from command line without waiting for input. In such case oneliner below could help:

echo "root:new_password" | chpasswd

Leave a Reply

Your email address will not be published. Required fields are marked *