2018-11-10 21:05:37 +00:00
|
|
|
|
---
|
|
|
|
|
layout: page
|
|
|
|
|
category-page: intermediate
|
2018-11-12 10:47:50 +00:00
|
|
|
|
category-title: Intermediate commands
|
2018-11-10 21:05:37 +00:00
|
|
|
|
tags: password change pwd user
|
|
|
|
|
author: Fabiano Fenini
|
|
|
|
|
title: passwd
|
|
|
|
|
previous-page: ""
|
|
|
|
|
---
|
2018-11-12 10:47:50 +00:00
|
|
|
|
The <code>passwd</code> command allows us to change or to assign a password of authentication
|
2018-11-10 21:05:37 +00:00
|
|
|
|
of an user currently in the system.<br>
|
|
|
|
|
When the user doesn’t have particular privileges, he is only able to change is password,
|
|
|
|
|
while the root user has the possibility to change also other users’ passwords.<br>
|
2018-11-12 10:47:50 +00:00
|
|
|
|
The command name stands for <i>password</i>.<br><br>
|
2018-11-10 21:05:37 +00:00
|
|
|
|
|
2018-11-12 10:47:50 +00:00
|
|
|
|
<h3>Usage</h3>
|
2018-11-10 21:05:37 +00:00
|
|
|
|
|
|
|
|
|
The default passwd command syntax is:
|
|
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
|
passwd [flags] [user]
|
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
|
|
Where [flags] are the passwd flags, read below for more info, the parameter [user] can only be
|
|
|
|
|
specified by the root user. If no user is provided, passwd proceed to set the password of the
|
2018-11-12 10:47:50 +00:00
|
|
|
|
user who uses this command. You will first be asked to enter the current user password.<br><br>
|
2018-11-10 21:05:37 +00:00
|
|
|
|
|
2018-11-12 10:47:50 +00:00
|
|
|
|
<h3>Flags</h3>
|
2018-11-10 21:05:37 +00:00
|
|
|
|
|
|
|
|
|
Here are some of the most common passwd flags:
|
|
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
<li> <b>-d</b>: Delete the user password </li>
|
|
|
|
|
<li> <b>-h</b>: Get information about how to use this command </li>
|
|
|
|
|
<li> <b>-l</b>: Lock the password </li>
|
|
|
|
|
<li> <b>-u</b>: Unlock the password </li>
|
|
|
|
|
<li> <b>-S</b>: See the account status information </li>
|
|
|
|
|
</ul>
|