[SOLVED] .new files for /etc/passwd, /etc/shadow, etc.
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have noticed that my -current installation has some .new files for /etc/passwd, /etc/shadow, /etc/group, and /etc/gshadow. I can see that there are some differences between the two, in particular the current version of the file has my own user and a few other users I've made, while the .new version has users like e.g. ntp.
I would usually use `slackpkg new-config' to check whether there are .new files I need to look at, and use vimdiff to compare them - but these files aren't picked up by new-config, and I don't know about editing these files using vimdiff (my understanding is you should use vipw or vigr to edit /etc/passwd and /etc/group, and their respective shadow files). I'm not sure why these files aren't picked up by new-config - is there a reason for this?
In any case, I have never edited these files directly before (e.g. I would use useradd and groupadd to add new users and groups). I'm not entirely sure how Slackware treats them - my basic understanding is that, as long as you use vipw or vigr and the passwd and group files have entries corresponding to their respective shadow files, it's safe to edit these files directly.
Is it safe for me to use vipw and vigr to compare these files and pull over user or group entries as they appear in the .new files? There only appear to be a few new users and groups, and there are only inserts and deletions between the original and .new files (no partially different lines).
I'm not sure why these files aren't picked up by new-config - is there a reason for this?
Those files are for shadow configuration and they are crucial for your user authentication. Mindless messing with them may put down your user logins.
In other hand, the Slackware packages which adds new system users and groups, they also adds on-fly these "patches" to the current config files, then I believe that's better to just delete the corresponding ".new" files, without trying to mess with them.
Obviously the new files won't have your personal user and group settings in them. They are generic. That's why they are filed as .new files alongside your versions. If they overwrote them, you'd lose your login details!
If it was my system, I wouldn't mess with any of the existing lines in these files but would add in the new lines by hand (unless, as LuckyCyborg suggests, they've already been written in by installpkg). And yes, you should use the specialised editing programs like vipw, just as you would use visudo to edit your sudoers file. These programs protect you from making catastrophic syntax errors.
You say there are some deletions too. If they are deletions of lines that have been added again with some differences, then I think you can safely delete them. Otherwise I should leave well alone. I don't think having extra users in these files is going to do any harm, even if those users aren't required any more..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.