You are not logged in.

#1 2012-10-05 13:41:27

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,471
Website

[SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

Hello,

During the regular updates I received an update of /etc/groups. I wonder what I should do here, as there are some differences between the old file and the pacnew one. I suppose that when I use the command to add my user to a group, it gets written into this file. So, just recklessly moving the pacnew file in the place of the old one, will mess up all my groups, won't it?

Then what should I do? All the entries in the pacnew file are also present in the old one, so I guess I could just delete the pacnew one and keep the old one. Am I right?

EDIT: The same goes to /etc/passwd and /etc/gshadow.

Last edited by Unia (2012-10-06 09:51:23)


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#2 2012-10-05 13:49:09

karol
Archivist
Registered: 2009-05-06
Posts: 25,427

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

There are some new additions e.g. uuidd group https://projects.archlinux.org/svntogit … 0950e5801c

Unia wrote:

All the entries in the pacnew file are also present in the old one,

Really? If you want a user to be part of a group removing that info won't help: https://projects.archlinux.org/svntogit … 0950e5801c

Last edited by karol (2012-10-05 13:56:02)

Offline

#3 2012-10-05 14:01:02

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,047
Website

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

If you had the uuid user before like me the uuid line in your own files is different from the pacnew file. You have to delete the uuid line near the bottom in your old file. Then insert the new uuid entry including the new number in the place near the top suggested by the pacnew file. Keep the other lines untouched, then save your changes and delete the pacnew files.

Edit: On a system that has actually been modified from a default install the new files will for sure be different to the old ones.

Last edited by teateawhy (2012-10-05 14:03:14)

Offline

#4 2012-10-05 17:22:01

esuhl
Member
From: UK
Registered: 2009-09-16
Posts: 75

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

teateawhy wrote:

If you had the uuid user before like me the uuid line in your own files is different from the pacnew file. You have to delete the uuid line near the bottom in your old file. Then insert the new uuid entry including the new number in the place near the top suggested by the pacnew file. Keep the other lines untouched, then save your changes and delete the pacnew files.

Edit: On a system that has actually been modified from a default install the new files will for sure be different to the old ones.

Thanks, teateawhy!  I currently have this listed in /etc/passwd:

uuidd:x:998:998::/:/sbin/nologin

And this is in the .pacnew file:

uuidd:x:68:68:uuidd:/:/sbin/nologin

So, I can just copy the entry from the .pacnew file, overwriting the old entry, right?

What I don't understand is how the two numbers 998 representing the UID and GID can suddenly change to 68.  Shouldn't they have to correspond with some other reference or list of users/groups...?

I'm sure it's fine to just replace the entry as you suggested, but I wondered if there was a way to double-check which uid/gid should be used?  It's not that I don't trust you, but I don't fully understand how these group/passwd files work and I'm trying to get my head round it all.

Cheers,

esuhl

Offline

#5 2012-10-05 17:46:51

demaio
Member
From: Germany
Registered: 2012-09-02
Posts: 62
Website

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

esuhl wrote:

Thanks, teateawhy!  I currently have this listed in /etc/passwd:

uuidd:x:998:998::/:/sbin/nologin

And this is in the .pacnew file:

uuidd:x:68:68:uuidd:/:/sbin/nologin

So, I can just copy the entry from the .pacnew file, overwriting the old entry, right?
esuhl

Don't do this. If you do, the user "uuidd" gets a new UserID (68) but this won't magically update the filesystem. If user "uuidd" did own some files, they now would be owned by UserID 998 who has no corresponding passwd entry. This could lead to all sorts of errors.

Changing UserIDs is a more complex task...

Mario

Offline

#6 2012-10-05 19:14:28

n125
Member
Registered: 2011-12-30
Posts: 38

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

When managing these new *.pacnew files today, I noticed that I also have the following files, which I don't recall seeing before:

-rw------- 1 root root 809 Sep 23 15:25 /etc/group-
-rw------- 1 root root 566 Sep 23 15:25 /etc/passwd-
-rw------- 1 root root 699 Sep 23 15:25 /etc/gshadow-

(Note the dashes "-" at the end of the filenames)

What are these, and is it safe to remove them? They seem to be identical to /etc/(group, passwd, gshadow), but they also contain entries for something called "usbmux". If I shouldn't remove them, should I do something to them, like add the changes present in today's *.pacnew files?

Offline

#7 2012-10-05 19:41:17

headkase
Member
From: Canada
Registered: 2011-12-06
Posts: 1,428
Website

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

demaio wrote:
esuhl wrote:

Thanks, teateawhy!  I currently have this listed in /etc/passwd:

uuidd:x:998:998::/:/sbin/nologin

And this is in the .pacnew file:

uuidd:x:68:68:uuidd:/:/sbin/nologin

So, I can just copy the entry from the .pacnew file, overwriting the old entry, right?
esuhl

Don't do this. If you do, the user "uuidd" gets a new UserID (68) but this won't magically update the filesystem. If user "uuidd" did own some files, they now would be owned by UserID 998 who has no corresponding passwd entry. This could lead to all sorts of errors.

Changing UserIDs is a more complex task...

Mario

Dammit, I went and changed the uuidd from 998 to 68.  Is there any way I can tell what files it may have owned?  Should I change it back?


We all make choices, but in the end, our choices make us.

Offline

#8 2012-10-05 19:47:01

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,448
Website

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

@headcase - Google is your friend.

Last edited by graysky (2012-10-05 19:48:51)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Online

#9 2012-10-05 19:50:54

Lekensteyn
Member
From: Netherlands
Registered: 2012-06-19
Posts: 179
Website

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

n125, those are backup files, possibly created by the usermod tools. You can safely remove them if you miss those bytes.

Mario, I do not see any processes running under user "uuidd" and the only file owned by uuidd is the directory /run/uuidd/. Looking around (manpage, `locate uuidd.service`) I think that most users here do not need to worry about existing files/directories/processes owned by uuidd.

/usr/lib/systemd/system/uuidd.service is a daemon for generating UUIDs, but I doubt that this added by most users here.

Offline

#10 2012-10-05 19:51:17

demaio
Member
From: Germany
Registered: 2012-09-02
Posts: 62
Website

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

headkase wrote:

Dammit, I went and changed the uuidd from 998 to 68.  Is there any way I can tell what files it may have owned?  Should I change it back?

Look for the "-uid" and "-gid" options in find to find the files which are owned by a specific numeric id. e.g.

find / -uid 998
find / -gid 998

Offline

#11 2012-10-05 19:53:15

headkase
Member
From: Canada
Registered: 2011-12-06
Posts: 1,428
Website

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

graysky wrote:

@headcase - Google is your friend.

Thank you, I did:

find / -user uuidd

And not including permission error folders all that was returned was:

/run/uuidd

Which is an empty folder.  I did change the uuidd user back to the user ID it was previously and rebooted before I did "find."

I believe "/run" is all handled at run-time so it should not matter if the user ID for uuidd was different?


We all make choices, but in the end, our choices make us.

Offline

#12 2012-10-05 19:54:49

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,448
Website

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

You'll need to run that as root... and yes, /run is not for you to worry about.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Online

#13 2012-10-05 19:57:02

headkase
Member
From: Canada
Registered: 2011-12-06
Posts: 1,428
Website

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

Good, I didn't bork my system.  Now that I'm aware of uid's I'll take more care, as in not change, with them in the future.

Edit:
And to confirm it I did:

sudo find / -uid 68

which returned nothing.  So when I initially set the new user number, 68, and rebooted that time it did not make a persistent change in the file-system.

Last edited by headkase (2012-10-05 20:08:37)


We all make choices, but in the end, our choices make us.

Offline

#14 2012-10-05 20:17:59

root
Member
From: 127.0.0.1
Registered: 2012-04-13
Posts: 297

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

Well, in my case taking advantage of demaio's find hint, not only /run/uuidd pops up as a result but also

- .gvfs file in my user's home

- several /proc folders related to tasks (with different IDs depending on running -uid or -gid) that are nonetheless reported to be a non-existent files/folders.

@headkase

As far as understand it you get nothing because the new group/user id does not own anything, yet, on your system. The problem would if there are still files related to the old id which would be kind of 'orphans' if you ask me.

Last edited by root (2012-10-05 20:23:47)


\(o_X)/
                        'Cause I wanna be an Archy - An Archy in the UK // Sex Pistols

Offline

#15 2012-10-05 20:22:12

headkase
Member
From: Canada
Registered: 2011-12-06
Posts: 1,428
Website

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

I shouldn't say it returned "nothing", it actually returned:

[bill@Jeremiah ~]$ sudo find / -uid 68
[sudo] password for bill: 
find: `/proc/758/task/758/fd/5': No such file or directory
find: `/proc/758/task/758/fdinfo/5': No such file or directory
find: `/proc/758/fd/5': No such file or directory
find: `/proc/758/fdinfo/5': No such file or directory
find: `/run/user/1000/gvfs': Permission denied

Where 998 returns:

[bill@Jeremiah ~]$ sudo find / -uid 998
find: `/proc/761/task/761/fd/5': No such file or directory
find: `/proc/761/task/761/fdinfo/5': No such file or directory
find: `/proc/761/fd/5': No such file or directory
find: `/proc/761/fdinfo/5': No such file or directory
/run/uuidd
find: `/run/user/1000/gvfs': Permission denied

So, I'm assuming that lines beginning with "find: `" are not actually results but instead output messages from the find command..


We all make choices, but in the end, our choices make us.

Offline

#16 2012-10-05 20:23:42

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

Hi guys,

TL;DR: if you change the uuidd uid/gid or not does not matter, either way is fine.

This is what happened:

The uuidd user/group was being created on install by the util-linux package. Since the uuidd user/group does not actually own any persistent files we did not hard-code a uid/gid as it did not matter.

However, it turns out that the uuidd user/group not existing before util-linux was installed caused some issues on fresh installs, so to work around that we added them to the gid/uid's we hardcode in the filesystem package. This required us to pick specific gid/uid numbers, which is why they are likely to differ from what you already have on your system.

You can just leave the numbers alone if you already have the user/group. If you decide to change them to the new numbers that's fine too, just remember to do a reboot so that /run/uuidd is recreated with with the correct owner/group.

Sorry for the inconvenience,

Tom

Offline

#17 2012-10-05 20:32:44

root
Member
From: 127.0.0.1
Registered: 2012-04-13
Posts: 297

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

@tomegun

Thanks for the heads-up.

I wonder though if it wouldn't be 'safe' to do the number change anyway as, at least as far as I understand it, the different IDs will pop up sooner or later with a new filesystem package update and this 'different IDs what should I do?' discussion would pop up again (especially if those who keep the numbers forget why they actually kept them in the future).


\(o_X)/
                        'Cause I wanna be an Archy - An Archy in the UK // Sex Pistols

Offline

#18 2012-10-05 22:54:22

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,661

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

The uid/gid I was assuming would not matter so I was not planning to change this. (I have quite a lot of differences in these files for other reasons but those I'm also mostly happy to leave as they are - I don't expect the user and group texlive to exist in Arch by default!)

However, there was one difference regarding uuidd which I wasn't sure about:

uuidd:x:68:68:uuidd:/:/sbin/nologin
uuidd:x:995:995::/:/sbin/nologin

I'm not worried about the different uid/gid but I'm not sure whether I should add the second occurrence of "uuidd".


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#19 2012-10-05 22:57:59

progandy
Member
Registered: 2012-05-17
Posts: 2,146

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

The fifth field doesn't matter, it just stores some comments and maybe a display name. see 'man 5 passwd' for more details.

Offline

#20 2012-10-05 23:01:37

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,661

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

progandy wrote:

The fifth field doesn't matter, it just stores some comments and maybe a display name. see 'man 5 passwd' for more details.

Thanks - forgot the 5...


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#21 2012-10-06 08:55:48

89c51
Member
Registered: 2012-06-05
Posts: 648

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

Sooooo

We just copy the uuid related line from the pacnew files to the old files and we are set. Right???? (and reboot of course)

Offline

#22 2012-10-06 09:24:26

ZekeSulastin
Member
Registered: 2010-09-20
Posts: 266

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

I would strongly consider scrolling up about 5 posts and seeing the dev response.

Offline

#23 2012-10-06 09:29:38

89c51
Member
Registered: 2012-06-05
Posts: 648

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

I just wanted a confirmation. tongue

Offline

#24 2012-10-06 09:51:09

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,471
Website

Re: [SOLVED] Today's update of /etc/group, /etc/passwd and /etc/gshadow

Cheers guys! I changed the uuidd numbers in all files and rebooted. It seems to still work.. wink

I'll mark this as solved!


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

Board footer

Powered by FluxBB