Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In any linux system I have access to (a couple of Archlinuxes, an Ubuntu, a Debian Sid and a Gentoo) there are the following 4 files in /etc/, all ending with a dash:


On the internet they say that these are just backup files, updated to the next to last change.

Now I'm wondering: who's creating those files? Is it my editor? Is it the application editing those files (gpasswd, useradd, groupadd and so on)? Is it something at a lower level (maybe even a kernel module)?

share|improve this question
up vote 19 down vote accepted

The backup files are created by the program that modifies your /etc/group or /etc/passwd files like useradd, groupadd and the like created as a safety precaution in case files get corrupted during edit. Kernel never touches those files.

share|improve this answer
It's strange, because shadow and gshadow files (with a dash), have different chmod, unlike 000 and can be read by other users? Is there a way to make backups with proper chmod keeping 000? – Ilia Rostovtsev Nov 27 '13 at 9:49
@IliaRostovtsev As far as I know the shadow and gshadow files have permissions of 0400. – Karlson Nov 27 '13 at 13:17
No, on CentOS, Fedora/RedHat it's set to 0000. It's insecure to have it set to 0400, I believe because any user on your system could run cat /etc/shadow and get the output of it? – Ilia Rostovtsev Nov 27 '13 at 15:43
@IliaRostovtsev First off I am looking at permissions on /etc/shadow on a RedHat system and if it actually is possible for non-root to view this file with permissions of 0400 it means that there a significant bug in permission processing unless the file is owned by some other user. – Karlson Nov 27 '13 at 16:31
I think it's the right way to keep this file chmod 0000. I don't think this is a bug but intended as some system files must be read by other users? – Ilia Rostovtsev Nov 27 '13 at 16:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.