Blog

How to change root password on Debian Linux

I am a new user of Debian Linux operating systems. I need to change the password for root user account on a Debian Linux. How do I change the root password on Debian Linux using passwd command line options?

Introduction – You need to use the passwd command. It is used to update the user’s authentication token(s) i.e. password. Let us see how to change the root user password on Debian Linux version 8.x/9.x.

How to change root password on Debian Linux

The procedure for changing the password of root is as follows:

  1. First, log in to the Debian Linux server using ssh or console
  2. Open a shell prompt and type the passwd command to change root password in Debian Linux
  3. The actual command to change the password for root on Debian Linux is sudo passwd root

NOTE: Please note that [vivek@debian-linux9:~]$ is my shell prompt. You need to type commands after the $ prompt.

Debian Linux change root password command

I am going to log in to my Debian Linux 7.x/8.x/9.x server using the ssh command:
ssh vivek@debian-linux9
Once logged in enter the command passwd as follows:
[vivek@debian-linux9:~]$ sudo passwd root
First you need to type the password for vivek user. After that the passwd command asks for the new password, which you will have to enter two times:

Changing root account passwords on a Debian Linux based system

The next time you log in to a Debian Linux server/workstation, use the new password.

Slightly different procedure for changing passwords in Debian Linux

One can use the following procedure too:
[vivek@debian-linux9:~]$ ssh user@your-centos-server-name-ip
Become a root user via the su command or sudo command:
[vivek@debian-linux9:~]$ sudo -i
OR
[vivek@debian-linux9:~]$ su -
Finally change your root user password:
passwd

Conclusion

This page explained the process for changing the password of root user using the passwd command on a Debian Linux server 9.x. For more info see man page of the passwd command by typing the following man command:
man 5 passwd
man passwd
man 5 shadow

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Related posts

A G20 Crypto Policy? Let’s Hope It’s a Pipe Dream

Viking Coin

Bitcoin Drops Below $3.4K to Set a New 2018 Low

Viking Coin

Linux List All Users In The System

Viking Coin

What Exactly Does the US Government Really Think of Bitcoin? Here’s the Story so Far

Viking Coin

Coinbase Raises $25 Million in Bitcoin’s Biggest Ever Funding Deal

Viking Coin

Blockchain Startup Symbiont Partners With Security Giant Gemalto

Viking Coin

$15,000: Is There a Limit to Bitcoin’s Meteoric Rally?

Viking Coin

Countdown Restarts Today for SEC Decision on CBOE-VanEck Bitcoin ETF

Viking Coin

How To Install Docker on CentOS 7

Viking Coin