Linux 使用/etc/passwd-、/etc/shadow-、/etc/group-

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7872907/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 06:50:19  来源:igfitidea点击:

Use of /etc/passwd-, /etc/shadow-, /etc/group-

linuxuser-accountspasswd

提问by nitin_cherian

In addition to the files : /etc/group, /etc/passwdand /etc/shadow, I could see three files in my linux machine.

除了文件 : /etc/group/etc/passwd/etc/shadow,我还可以在我的 linux 机器中看到三个文件。

  1. /etc/group-
  2. /etc/passwd-
  3. /etc/shadow-
  1. /etc/group-
  2. /etc/passwd-
  3. /etc/shadow-

I cannot see these files in my root filesystem. But when I try to add one user using useraddcommand, these files seem to get generated.

我在我的root filesystem. 但是当我尝试使用useradd命令添加一个用户时,这些文件似乎被生成了。

So i would like to know when exactly is these files created and what is the use of these files?

所以我想知道这些文件是什么时候创建的,这些文件有什么用?

采纳答案by Petr

These are backups of previous versions.

这些是以前版本的备份。

Manual pages show these files and states:

手册页显示这些文件和状态:

/etc/passwd-

/etc/passwd-

Backup file for /etc/passwd.

/etc/passwd 的备份文件。

/etc/shadow-

/etc/shadow-

Backup file for /etc/shadow.

/etc/shadow 的备份文件。

Note that this file is used by the tools of the shadow toolsuite, but not by all user and password management tools.

请注意,该文件由 shadow 工具套件的工具使用,但并非由所有用户和密码管理工具使用。

See http://manpages.ubuntu.com/manpages/oneiric/man5/shadow.5.htmland http://manpages.ubuntu.com/manpages/oneiric/man5/passwd.5.html

请参阅http://manpages.ubuntu.com/manpages/oneiric/man5/shadow.5.htmlhttp://manpages.ubuntu.com/manpages/oneiric/man5/passwd.5.html