Debian – How to change the root password on Debian

debianpasswordroot

I want to change the password I assigned to root on my Debian webserver to something longer and more secure.

How do I do that? I haven’t forgotten/lost the current password, I just want to change it.

Best Answer

Ah, use the passwd program as root:

sudo passwd root

Or, if you’re running as root already (which you shouldn’t be), just:

passwd

The root argument can be omitted, because when you execute passwd it defaults to the current user (which is root, as only root can change the root password).

Related Question