LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bedrock Linux
User Name
Password
Bedrock Linux This forum is for the discussion of Bedrock Linux.

Notices


Reply
  Search this Thread
Old 03-27-2016, 11:31 AM   #1
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651
Blog Entries: 135

Rep: Reputation: 188Reputation: 188
user numbers in etc/passwd


Greetings.

I am thinking of trying the current version of bedrock. I have one question from when I tried the previous version. I had noticed that the numbers assigned to users in the bedrock /etc/passwd file did not all match those of /etc/passwd the first client (well, now called strata).

Do these numbers need to match?

I can obviously go and change them in /etc/passwd, but I would *think* that files in the file systems have the "raw" number rather than a string with the user name?

Come to think of it, this question applies to groups as well.

p.s. I have installed bedrock succesfully, once, in a VM. Some stuff was a bit funny, but it was able to get into xorg and go online. An attempt to set it up on a physical machine did not go as well, but hey, this is new technology.
 
Old 03-27-2016, 12:31 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
The user name is for your convenience, system identifies users by "those numbers", which are called UID and GID.
 
Old 03-27-2016, 02:51 PM   #3
ParadigmComplex
Bedrock Linux Founder
 
Registered: Feb 2016
Distribution: Bedrock Linux
Posts: 179

Rep: Reputation: Disabled
Quote:
Originally Posted by jr_bob_dobbs View Post
Greetings.
Howdy

Quote:
Originally Posted by jr_bob_dobbs View Post
I am thinking of trying the current version of bedrock. I have one question from when I tried the previous version. I had noticed that the numbers assigned to users in the bedrock /etc/passwd file did not all match those of /etc/passwd the first client (well, now called strata).
With the default/recommended configs, processes should all see the same file at /etc/passwd, irrelevant of which stratum provides them, as it is a global file. If that's not the case, either the system is misconfigured, or there's a bug.

If you're looking at the files through explicit access (that is, through /bedrock/strata/*stratum*/etc/passwd rather than directly at /etc/passwd), then they can differ. Or they can be the same. There's no rule about what global files look like when accessed through there; it's undefined. That access is only defined for local files.

Quote:
Originally Posted by jr_bob_dobbs View Post
Do these numbers need to match?
Assuming direct access (that is, through /etc/passwd and not /bedrock/strata/*stratum*/etc/passwd), you most likely want them to match. There may be some fancy exceptions where you want them to differ, but I can't think of any at the moment.

Quote:
Originally Posted by jr_bob_dobbs View Post
I can obviously go and change them in /etc/passwd, but I would *think* that files in the file systems have the "raw" number rather than a string with the user name?
The filesystem does use the underlying user id. However, this doesn't alleviate potential problems from /etc/passwd mismatches. Processes from different strata would look up the username-uid mappings and try to do things with the filesystem based on what they think the user id should be and then get very confused.

Quote:
Originally Posted by jr_bob_dobbs View Post
Come to think of it, this question applies to groups as well.
It does - same idea, just /etc/group instead of /etc/passwd. That should also be in sync.

Quote:
Originally Posted by jr_bob_dobbs View Post
p.s. I have installed bedrock succesfully, once, in a VM. Some stuff was a bit funny, but it was able to get into xorg and go online. An attempt to set it up on a physical machine did not go as well, but hey, this is new technology.
If the funny things you ran into don't show up in the known issues page or in the github issues page, and you think it's an issue with Bedrock Linux rather than a mistake on your part or an issue with software from another distro, please do report it so I can look into it.

If you think it was a mistake on your part, feel free to request assistance, that's what this forum is for
 
Old 03-27-2016, 05:13 PM   #4
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651

Original Poster
Blog Entries: 135

Rep: Reputation: 188Reputation: 188
Sigh, poor phrasing on my part. The "hey this is new technology" to me implied, high tech, as in, things beyond my knowledge. In other words, this *is* rocket science. So I *expect* to make mistakes and to fail to understand some things. I did not intend to imply anything negative about bedrock. My attitude towards bedrock is one of enthusiasm and wonder.
 
Old 03-27-2016, 05:26 PM   #5
ParadigmComplex
Bedrock Linux Founder
 
Registered: Feb 2016
Distribution: Bedrock Linux
Posts: 179

Rep: Reputation: Disabled
Oh no worries, I didn't interpret it as any sort of slight! Always happy to hear about such enthusiasm
 
Old 06-24-2016, 07:21 AM   #6
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651

Original Poster
Blog Entries: 135

Rep: Reputation: 188Reputation: 188
edit:
Oops! I'm comparing a list of users to a list of groups! Let me get back to you on that once I properly check users vs. users and groups vs groups.
end edit


Getting specific numbers now, I'm thinking of beginning a bedrock install (yes, I'm taking my time at this ) with a hijack of the November 2015 version of Slackware "current". The numbers Slackware has for the users are:
Code:
root 0
bin 1
daemon 2
adm 3
lp 4
sync 5
shutdown 6
halt 7
mail 8
news 9
uucp 10
operator 11
games 12
ftp 14
smmsp 25
mysql 27
rpc 32
sshd 33
gdm 42
oprofile 51
usbmux 52
sddm 64
apache 80
messagebus 81
haldaemon 82
pop 90
nobody 99
bob 1000
Note: that was extacted from the passwd file.

According to the quick install instructions for Nyla, the numbers should be
Code:
0 root
5 tty
6 disk
7 lp
15 kmem
20 dialout
24 cdrom
25 floppy
26 tape
29 audio
44 video
50 staff

65534 nogroup or 60000 nogroup
A quick look reveals some apparent conflicts. For example: bedrock's tty uses 5 but slackware uses that for sync. How flexible are these numbers? Would it be workable to simply go with the slackware numbers? Or, instead, are these numbers hard-coded deep within bedrock?

Last edited by jr_bob_dobbs; 06-26-2016 at 05:25 PM. Reason: woops
 
Old 06-26-2016, 05:53 PM   #7
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651

Original Poster
Blog Entries: 135

Rep: Reputation: 188Reputation: 188
All right. Got my act together. Here are the groups specified by number in the Nyla quick-start documentation that have numbered different from groups in the to-be-hijacked linux:
Code:
group	slack	bedrock
kmem	9	15
dialout	16	20
cdrom	19	24
floppy	11	25
audio	17	29
video	18	44
In addition, there is a group in bedrock that is not in the linux that has the same number as an existing group in the linux. This group is staff, with a number of 50. In the linux, 50 is used by the ftp group.

Will this be a problem after the hijack?

I see no mention of users with specified numbers, so it looks like that might not be a concern after all.
 
Old 06-27-2016, 03:37 AM   #8
EmaRsk
Member
 
Registered: Mar 2006
Distribution: Mint, WSL Ubuntu
Posts: 134

Rep: Reputation: 32
I think that if you hijack a distro, you'd better just use that distro's passwd and group files as a starting base (with the correction for root's and users' shells, of course), then add whatever needed for other strata by checking each new strata's defaults and adding whatever is missing.

You should take care of any conflict with other strata IDs by scanning every other strata's filesystem and looking for files that DON'T belong to root:root[*], and chown'ing them to whatever UID:GID numbers you choose for that user:group to solve the conflict.

For example: Void's package manager has the executable /usr/bin/xbps-uchroot owned by root:xbuilder, which by Void's defaults corresponds to 0:101.

You need to create or copy the xbuilder group to your global /etc/group file; if the 101 GID is already taken you can use another number, but then you need to chgrp the /usr/bin/xbps-uchroot file to the GID number you're using, and probably do that every time you update the Void package manager.

[*]
Code:
brs disable new_stratum
find /bedrock/strata/new_stratum/ \! \( -uid 0 -gid 0 \) -exec ls -n '{}' \+

Last edited by EmaRsk; 06-29-2016 at 06:01 PM. Reason: fix typo
 
1 members found this post helpful.
Old 06-27-2016, 07:02 AM   #9
ParadigmComplex
Bedrock Linux Founder
 
Registered: Feb 2016
Distribution: Bedrock Linux
Posts: 179

Rep: Reputation: Disabled
The various uid/gid numbers are not "hard-coded deep within bedrock". That bit of the instructions is simply ensuring you have some values there. Whatever Slackware starts with is fine - just make sure if it's missing something that's listed in the quick start instructions, you get the missing thing. I should probably reword that section of the instructions to be more clear.

EmaRsk is also correct in that when you add a new stratum, it may be advisable to merge the uids and gids and ensure the on-disk values are correct. We had someone working on a utility to automate such merging, but they've moved on elsewhere before finishing it. We'll have to get back to it.
 
1 members found this post helpful.
Old 06-27-2016, 06:04 PM   #10
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651

Original Poster
Blog Entries: 135

Rep: Reputation: 188Reputation: 188
Thank you, everyone, for the information.

@EmaRsk: Neat! My experience with find has been minimal. This could be the basis of a script.

Last edited by jr_bob_dobbs; 06-27-2016 at 06:15 PM.
 
Old 09-16-2016, 06:08 AM   #11
EmaRsk
Member
 
Registered: Mar 2006
Distribution: Mint, WSL Ubuntu
Posts: 134

Rep: Reputation: 32
Just a correction, in case someone is copy-pasting the 'find' line above: 'ls' should have the '-d' option, or else it would list the content of the found directories, instead of the directories themselves.
Code:
brs disable new_stratum
find /bedrock/strata/new_stratum/ \! \( -uid 0 -gid 0 \) -exec ls -dn '{}' \+
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
su: Authentication failure for root user even login wright user passwd jsaravana87 Linux - Server 1 02-09-2012 11:36 AM
user can't change user account passwd rcmonroig Linux - Newbie 3 11-09-2009 09:44 PM
user passwd varunkant Linux - Newbie 4 06-17-2008 01:47 PM
How to increase the Linux User numbers m_shroom General 22 12-14-2006 08:18 AM
user and group numbers Furlinastis Linux - General 3 05-07-2006 05:15 PM

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

All times are GMT -5. The time now is 12:14 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