passwd命令修改密码

您所在的位置:网站首页 968和968-5区别 passwd命令修改密码

passwd命令修改密码

2023-10-04 10:29| 来源: 网络整理| 查看: 265

passwd命令修改密码

介绍 (Introduction)

Linux passwd command changes a user’s password. A user can only change his/her own password but the root/superuser may change any user’s password.

Linux passwd命令更改用户密码。 用户只能更改自己的密码,但root / superuser可以更改任何用户的密码。

Let’s look at the Linux man page to understand the usage of this command. This is done by typing in the following command:

让我们看一下Linux手册页,以了解此命令的用法。 通过键入以下命令来完成此操作:

$ man passwd Linux中的密码 (Passwords in Linux)

The traditional method of storing passwords in a UNIX based system involved storing the information in /etc/passwd file.

在基于UNIX的系统中存储密码的传统方法包括将信息存储在/ etc / passwd文件中。

This file, however, was accessed by many programs and hence posed a security risk.

但是,该文件已被许多程序访问,因此存在安全风险。

Nowadays, /etc/passwd file only contains essential user info required at login and authentication.

如今, /etc/passwd文件仅包含登录和身份验证所需的基本用户信息。

The actual encrypted version of the password is stored in a separate file – /etc/shadow. This file can only be accessed by the root user.

密码的实际加密版本存储在单独的文件/etc/shadow 。 该文件只能由root用户访问。

/etc/passwd file looks as follows: Passwd File Contents

passwd file contents

Each line of the file contains general user information about a certain program or user. The fields are separated by :. These field are as follow:

Username (upto 8 characters) x to denote the password, which is stored in the /etc/shadow file in encrypted format. Numeric User ID. Numeric Group ID. Full username. Path of the home directory. Path of the preferred shell. ("/bin/bash")

/etc/passwd文件如下所示:

passwd文件内容

文件的每一行都包含有关某个程序或用户的一般用户信息。 这些字段用:分隔。 这些字段如下:

用户名(最多8个字符) x表示密码,该密码以加密格式存储在/etc/shadow文件中。 数字用户ID。 数字组ID。 完整的用户名。 主目录的路径。 首选外壳的


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3