Security

How To: Change Your Password In The Terminal

It’s considered good form to change your password once in a while. This may not be something important for you, but others may appreciate it. It may be corporate policy or regulations that make you need to change your password, or you could just be more security minded than many others. No matter what, this article tells you how.

The tool we’re using in today’s exercise is called ‘passwd‘, which is a tool to help make and manage passwords. It’s a bit complicated, but it uses something called hashing and stores a hash instead of a plain-text password.

When you login, your password is checked against the hash that was created when the password was created. This prevents people from easily reading your stored password, stored of course because there must be something to check against.

If one remembers way back to the start of this project, my goal is to put my notes online. This article is in my notes, which is why this is such a simple article. Indeed, this article should be pretty straightforward and easy to understand. I’d definitely call it a beginner-friendly article.

Change Your Password:

Like most always, you need to open your terminal. You can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

Once you have your terminal open, the command you’re looking for is:

passwd

If you already have a password, you’ll need to type your current password and then you’ll type the new password twice. When you logout or next need to use your password, your new password will be required. You don’t need ‘sudo’ for this, as the password you’re changing belongs to you.

Seeing as this is short, I’ll toss in another use of passwd. If you want to change the password for a different user, you just use this command:

sudo passwd <user_name>

Change the obvious to the obvious, specifically the username. This command does require ‘sudo’, because you’re changing a password that doesn’t belong to the current user.

There’s more that can be done with passwd, but those things are beyond the scope of this article. I’d expect to see some more passwd uses covered in the future, but you can get a head start by typing man passwd into your terminal and learning about the other options.

Closure:

That’s it, really. I told you that this one would be short and easy! Sure enough, it’s pretty easy. Many of my notes are regarding people who are new to Linux, but it’s still nice to get more of them online. I dare say we’re coming along nicely.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Recent Posts

How To: Install Wine In Lubuntu

Today's article isn't going to be complicated or long as we are going to cover…

7 hours ago

Update Python Packages (PIP)

We've had a run of Python packages recently and you can tell that I'm a…

2 days ago

Save A Command’s Output To A File (While Showing It In The Terminal)

The title is the best I can come up with to describe this exercise as…

4 days ago

Demystifying journalctl: A Comprehensive Guide to Linux System Logging

It was suggested that I write an article about journalctl, which seemed like a large…

6 days ago

Extract Text From Multiple File Types

Today we will have a fairly simple exercise as we're going to just use a…

1 week ago

Meta: I’ve Been At This For Three Years!

I have not done a meta article lately. I don't find them interesting to write…

1 week ago