[arch-general] dbus update - /etc/passwd merge question
Having read the available postings in arch-dev-public as well as those on this subject in the arch forums I am somewhat confused as to how to complete the merge for /etc/passwd /etc/shadow /etc/group and /etc/gshadow for the new entries in the .pacnew files. For example in my old /etc/passwd I have the line: dbus:x:81:81:System message bus:/:/bin/false and in the pacnew file I have: dbus:x:81:81:dbus:/:/sbin/nologin Should I put the line from the .pacnew file into the old file? Also for uidd I have in the original: uuidd:x:999:999::/:/sbin/nologin but in the pacnew file it is: uuidd:x:68:68:uuidd:/:/sbin/nologin Should I change the uid in the original file to 68 - and do the same in the corresponding entries for shadow, group and gshadow? I am an old linux user and usually I can sort things out after an upgrade but this time I am really confused. Any expert advice very much appreciated - thanks. -- mike c
You can use vipw and vigr to safely edit the passwd and group files with your editor of choice, and make the changes (or use the cli utilities instead). There's no need to manually edit shadow/gshadow, you can update them by running pwconv and grpconv which will generate them by merging passwd with the current shadow, and group with the current gshadow. On Thu, Dec 6, 2012 at 11:55 AM, mike cloaked <mike.cloaked@gmail.com>wrote:
Having read the available postings in arch-dev-public as well as those on this subject in the arch forums I am somewhat confused as to how to complete the merge for /etc/passwd /etc/shadow /etc/group and /etc/gshadow for the new entries in the .pacnew files.
For example in my old /etc/passwd I have the line: dbus:x:81:81:System message bus:/:/bin/false
and in the pacnew file I have: dbus:x:81:81:dbus:/:/sbin/nologin
Should I put the line from the .pacnew file into the old file?
Also for uidd I have in the original: uuidd:x:999:999::/:/sbin/nologin
but in the pacnew file it is: uuidd:x:68:68:uuidd:/:/sbin/nologin
Should I change the uid in the original file to 68 - and do the same in the corresponding entries for shadow, group and gshadow?
I am an old linux user and usually I can sort things out after an upgrade but this time I am really confused.
Any expert advice very much appreciated - thanks.
-- mike c
On 07/12/12 03:59, Daniel Micay wrote:
You can use vipw and vigr to safely edit the passwd and group files with your editor of choice, and make the changes (or use the cli utilities instead). There's no need to manually edit shadow/gshadow, you can update them by running pwconv and grpconv which will generate them by merging passwd with the current shadow, and group with the current gshadow.
On Thu, Dec 6, 2012 at 11:55 AM, mike cloaked <mike.cloaked@gmail.com>wrote:
Having read the available postings in arch-dev-public as well as those on this subject in the arch forums I am somewhat confused as to how to complete the merge for /etc/passwd /etc/shadow /etc/group and /etc/gshadow for the new entries in the .pacnew files.
For example in my old /etc/passwd I have the line: dbus:x:81:81:System message bus:/:/bin/false
and in the pacnew file I have: dbus:x:81:81:dbus:/:/sbin/nologin
Should I put the line from the .pacnew file into the old file?
Also for uidd I have in the original: uuidd:x:999:999::/:/sbin/nologin
but in the pacnew file it is: uuidd:x:68:68:uuidd:/:/sbin/nologin
Should I change the uid in the original file to 68 - and do the same in the corresponding entries for shadow, group and gshadow?
I am an old linux user and usually I can sort things out after an upgrade but this time I am really confused.
Any expert advice very much appreciated - thanks.
-- mike c
vipw and vigr don't seem to do anything for me. It doesn't matter what changes I make, they both report that nothing was changed.
# vipw (Makes changes in $EDITOR, writes and quits) vipw: no changes made vipw: /etc/passwd unchanged ?
On 13 December 2012 13:52, Robbie Smith <zoqaeski@gmail.com> wrote:
vipw and vigr don't seem to do anything for me. It doesn't matter what changes I make, they both report that nothing was changed.
# vipw (Makes changes in $EDITOR, writes and quits) vipw: no changes made vipw: /etc/passwd unchanged
?
I believe vipw and vigr will launch the file in using $EDITOR. Once you have made changes it will sanity check in a sandbox style before saving to the 'production' file. Correct me if I'm wrong please. Neil
On 14/12/12 01:04, Neil Perry wrote:
On 13 December 2012 13:52, Robbie Smith <zoqaeski@gmail.com> wrote:
vipw and vigr don't seem to do anything for me. It doesn't matter what changes I make, they both report that nothing was changed.
# vipw (Makes changes in $EDITOR, writes and quits) vipw: no changes made vipw: /etc/passwd unchanged
?
I believe vipw and vigr will launch the file in using $EDITOR. Once you have made changes it will sanity check in a sandbox style before saving to the 'production' file.
Correct me if I'm wrong please.
Neil
That's what it's supposed to do, according to all the documentation that I can find. But (for me at least), it opens a temporary file in $EDITOR named vi(pw|gr).XXXXXX, where XXXXXX is a random string. Upon editing the file and exiting the editor, instead of comparing and merging the changes to the production file, it does nothing. I've even made a copy of the production file myself (as an extra precaution), and deleted every line in the tmp file, and it still does nothing.
On Fri, Dec 14, 2012 at 8:39 AM, Robbie Smith <zoqaeski@gmail.com> wrote:
On 14/12/12 01:04, Neil Perry wrote:
On 13 December 2012 13:52, Robbie Smith <zoqaeski@gmail.com> wrote:
vipw and vigr don't seem to do anything for me. It doesn't matter what
changes I make, they both report that nothing was changed.
# vipw (Makes changes in $EDITOR, writes and quits) vipw: no changes made vipw: /etc/passwd unchanged
?
I believe vipw and vigr will launch the file in using $EDITOR. Once you have made changes it will sanity check in a sandbox style before saving to the 'production' file.
Correct me if I'm wrong please.
Neil
That's what it's supposed to do, according to all the documentation that I can find. But (for me at least), it opens a temporary file in $EDITOR named vi(pw|gr).XXXXXX, where XXXXXX is a random string. Upon editing the file and exiting the editor, instead of comparing and merging the changes to the production file, it does nothing. I've even made a copy of the production file myself (as an extra precaution), and deleted every line in the tmp file, and it still does nothing.
That may depend on the editor used, you didn't say what you use. I expect that if the editor exit code is anything other than EXIT_SUCCESS (that is 0) the edition is cancelled. And some editors out there may not be mindful about the exit status. I'd recommend to use for example "vi", that does it right, and see what happens. -- Rodrigo
On 14/12/12 19:37, Rodrigo Rivas wrote:
On Fri, Dec 14, 2012 at 8:39 AM, Robbie Smith <zoqaeski@gmail.com> wrote:
On 14/12/12 01:04, Neil Perry wrote:
On 13 December 2012 13:52, Robbie Smith <zoqaeski@gmail.com> wrote:
vipw and vigr don't seem to do anything for me. It doesn't matter what
changes I make, they both report that nothing was changed.
# vipw (Makes changes in $EDITOR, writes and quits) vipw: no changes made vipw: /etc/passwd unchanged
?
I believe vipw and vigr will launch the file in using $EDITOR. Once you have made changes it will sanity check in a sandbox style before saving to the 'production' file.
Correct me if I'm wrong please.
Neil
That's what it's supposed to do, according to all the documentation that I can find. But (for me at least), it opens a temporary file in $EDITOR named vi(pw|gr).XXXXXX, where XXXXXX is a random string. Upon editing the file and exiting the editor, instead of comparing and merging the changes to the production file, it does nothing. I've even made a copy of the production file myself (as an extra precaution), and deleted every line in the tmp file, and it still does nothing.
That may depend on the editor used, you didn't say what you use. I expect that if the editor exit code is anything other than EXIT_SUCCESS (that is 0) the edition is cancelled. And some editors out there may not be mindful about the exit status. I'd recommend to use for example "vi", that does it right, and see what happens. -- Rodrigo
I use Vim as my editor, for both my own user and root. Strangely enough, if I use vi (by passing a different value for $EDITOR), it works. # EDITOR=/usr/bin/vi vipw If I query the return status of vim though on the successful modification of a file, I get 0. So I don't know why it doesn't work with vipw.
On 14/12/12 19:37, Rodrigo Rivas wrote:
On Fri, Dec 14, 2012 at 8:39 AM, Robbie Smith <zoqaeski@gmail.com> wrote:
On 14/12/12 01:04, Neil Perry wrote:
On 13 December 2012 13:52, Robbie Smith <zoqaeski@gmail.com> wrote:
vipw and vigr don't seem to do anything for me. It doesn't matter what
changes I make, they both report that nothing was changed.
# vipw (Makes changes in $EDITOR, writes and quits) vipw: no changes made vipw: /etc/passwd unchanged
?
I believe vipw and vigr will launch the file in using $EDITOR. Once you have made changes it will sanity check in a sandbox style before saving to the 'production' file.
Correct me if I'm wrong please.
Neil
That's what it's supposed to do, according to all the documentation that I can find. But (for me at least), it opens a temporary file in $EDITOR named vi(pw|gr).XXXXXX, where XXXXXX is a random string. Upon editing the file and exiting the editor, instead of comparing and merging the changes to the production file, it does nothing. I've even made a copy of the production file myself (as an extra precaution), and deleted every line in the tmp file, and it still does nothing.
That may depend on the editor used, you didn't say what you use. I expect that if the editor exit code is anything other than EXIT_SUCCESS (that is 0) the edition is cancelled. And some editors out there may not be mindful about the exit status. I'd recommend to use for example "vi", that does it right, and see what happens. -- Rodrigo
Fixed it: turned off the writebackup option in root's ~/.vimrc, and it works properly. I should have asked the google about vim and vipw before posting =/
On 12/06/12 at 04:55pm, mike cloaked wrote:
Having read the available postings in arch-dev-public as well as those on this subject in the arch forums I am somewhat confused as to how to complete the merge for /etc/passwd /etc/shadow /etc/group and /etc/gshadow for the new entries in the .pacnew files.
For example in my old /etc/passwd I have the line: dbus:x:81:81:System message bus:/:/bin/false
and in the pacnew file I have: dbus:x:81:81:dbus:/:/sbin/nologin
Should I put the line from the .pacnew file into the old file?
Also for uidd I have in the original: uuidd:x:999:999::/:/sbin/nologin
but in the pacnew file it is: uuidd:x:68:68:uuidd:/:/sbin/nologin
Should I change the uid in the original file to 68 - and do the same in the corresponding entries for shadow, group and gshadow?
I am an old linux user and usually I can sort things out after an upgrade but this time I am really confused.
Any expert advice very much appreciated - thanks.
-- mike c
The dbus entries are actually the same except for the description. Setting a users shell to /sbin/nologin or /bin/false achieves the same thing. Also, I jsut looked at my passwd file and apparently I had merged my pacnew files to reflect the changed uid for uuidd. So mine is 68:68 and I have no issues. -- Curtis Shimamoto sugar.and.scruffy@gmail.com
Am 06.12.2012 18:15, schrieb Curtis Shimamoto:
Also, I jsut looked at my passwd file and apparently I had merged my pacnew files to reflect the changed uid for uuidd. So mine is 68:68 and I have no issues.
None of this really matters - the only place where uuidd is used is here: $ cat /usr/lib/tmpfiles.d/uuidd.conf d /run/uuidd 0755 uuidd uuidd As long as the user and group exist (no matter which UID/GID), everything will be fine. On top of that, virtually nobody uses uuidd.
Thanks for the reply and from Curtis - at least I can feel safe rebooting now! I will merge the uid change for uuidd just in case in the future the 999 uid is wanted by another package...... On Thu, Dec 6, 2012 at 5:25 PM, Thomas Bächler <thomas@archlinux.org> wrote:
Am 06.12.2012 18:15, schrieb Curtis Shimamoto:
Also, I jsut looked at my passwd file and apparently I had merged my pacnew files to reflect the changed uid for uuidd. So mine is 68:68 and I have no issues.
None of this really matters - the only place where uuidd is used is here:
$ cat /usr/lib/tmpfiles.d/uuidd.conf d /run/uuidd 0755 uuidd uuidd
As long as the user and group exist (no matter which UID/GID), everything will be fine. On top of that, virtually nobody uses uuidd.
-- mike c
On Thu, Dec 6, 2012 at 6:15 PM, Curtis Shimamoto < sugar.and.scruffy@gmail.com> wrote:
Setting a users shell to /sbin/nologin or /bin/false achieves the same thing.
[pedantic] Actually, there is a difference between `nologin` and `false`: `nologin` will print a polite message explaining that the account is not available; `false` prints nothing. [/pedantic] -- Rodrigo
On Thu, Dec 6, 2012 at 5:30 PM, Rodrigo Rivas <rodrigorivascosta@gmail.com>wrote:
On Thu, Dec 6, 2012 at 6:15 PM, Curtis Shimamoto < sugar.and.scruffy@gmail.com> wrote:
Setting a users shell to /sbin/nologin or /bin/false achieves the same thing.
[pedantic]
Actually, there is a difference between `nologin` and `false`: `nologin` will print a polite message explaining that the account is not available; `false` prints nothing.
[/pedantic]
Thank you for the helpful explanation and apologies for the accidental top post in my last post on this. -- mike c
participants (7)
-
Curtis Shimamoto
-
Daniel Micay
-
mike cloaked
-
Neil Perry
-
Robbie Smith
-
Rodrigo Rivas
-
Thomas Bächler