> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://jimcloud.crisp.help/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Linux 如何修改登录密码

在 Linux 中，修改登录密码的步骤如下：

## 1. 使用 `passwd` 命令修改密码

### 修改当前用户的密码

1. 打开终端。
2. 输入以下命令：

```bash
passwd
```

3. 系统会提示您输入当前密码。输入后按回车。
4. 然后，系统会提示您输入新密码。输入后按回车。
5. 再次输入新密码以确认，按回车。

### 修改其他用户的密码

如果您是超级用户（root）或具有 sudo 权限的用户，可以修改其他用户的密码：

1. 在终端中输入以下命令，替换 `username` 为目标用户名：

```bash
sudo passwd username
```

2. 系统会提示您输入新密码。输入后按回车。
3. 再次输入新密码以确认，按回车。

## 2. 密码复杂性和安全性

- 确保新密码足够复杂，包含字母、数字和特殊字符，以提高安全性。
- 避免使用容易猜测的密码，例如生日或常见的词汇。

## 注意事项

- **权限**：只有具有相应权限的用户才能修改其他用户的密码。
- **密码策略**：某些系统可能有密码复杂性要求，请根据提示设置符合要求的密码。

通过以上步骤，您可以在 Linux 中成功修改登录密码。