LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-11-2020, 08:48 AM   #1
uiopqwerty
Member
 
Registered: May 2020
Distribution: Slackware64 15.0
Posts: 31

Rep: Reputation: Disabled
.new files for /etc/passwd, /etc/shadow, etc.


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).
 
Old 07-11-2020, 09:01 AM   #2
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,598

Rep: Reputation: 3467Reputation: 3467Reputation: 3467Reputation: 3467Reputation: 3467Reputation: 3467Reputation: 3467Reputation: 3467Reputation: 3467Reputation: 3467Reputation: 3467
Quote:
Originally Posted by uiopqwerty View Post
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.
 
2 members found this post helpful.
Old 07-11-2020, 10:52 AM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
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..
 
1 members found this post helpful.
Old 07-20-2020, 06:45 AM   #4
uiopqwerty
Member
 
Registered: May 2020
Distribution: Slackware64 15.0
Posts: 31

Original Poster
Rep: Reputation: Disabled
Thanks for your help all - on closer inspection, the additional users had been appended to the passwd, group, and shadow files
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Legacy Account in /etc/passwd, /etc/shadow and/or /etc/group lalit singhania Linux - Newbie 4 06-07-2012 06:33 AM
Problem with /etc/passwd and /etc/passwd- files linuxravindra414 Linux - Newbie 2 01-15-2011 05:17 AM
[SOLVED] /etc/passwd- & /etc/shadow- & /etc/group- Mr. Alex Linux - Newbie 1 12-31-2010 05:19 AM
passwd.new, shadow.new, group.new and gshadow.new after upgrade to slackware 12.1 rhermsen Slackware 6 11-08-2008 04:59 PM
/etc/passwd, /etc/shadow, /etc/group? Educate me :)! nutnut Linux - General 4 06-11-2005 07:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration