uid problems

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
perbh

uid problems

Post by perbh »

The windowization of linux is still alive and well!!
The latest linuxmint-19 (64bit, xfce) will obviously NOT accept uid's less than 1000. I'm sorry, but this is ridiculous!!
For years and years and for more distros than I care to remember, I have used the same uid (in the 300-range if anyone is interested).
useradd will not be recognized (I have not tried useradd with a 1000+ uid). I have used the 'point-n-click' interface to create a new user, then changing the uid=1001 to my 'usual' uid - and suddenly it is no longer recognized. All the usual sysadm tricks (chmod -R {uid}:{gid} /home/{username} - oh it will do the right thing, but the uid is no longer recognized as a legal user.
With all due respect - and it might be _me_ overlooking the obvious ... but any help that can solve this problem will be more than welcome. The reason I want to use the same uid/gid is because of file permissions, I want all my rigs to be able to use the same uid/gid - and I will not change all my others because of any shortcomings of linuxmint.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: uid problems

Post by catweazel »

perbh wrote: Thu Oct 04, 2018 1:11 am The windowization of linux is still alive and well!!
FUD.
perbh wrote:
I snipped your rant and there's nowt left.

grep UID_MIN /etc/login.defs
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
perbh

Re: uid problems

Post by perbh »

I see where you are coming from (and I don't mean Aussie-land). Your solution was completely unknown to me, and I thank you for it. However, looking at your 'login.defs', it says, ever so clearly, that UID_MIN is for automatic uid-selection by useradd. It does not state that when giving a smaller value explicitly by useradd, that it will not be honoured. I haven't tried it out yet, but will (adjusting UID_MIN).

As for my rant, I apologize - I have been using linux since 1996, got rid of windows for good around 2000 and I see constant attempts to make linux look more and more like windows. I like to work with the command line, I really, really do not want a gui up until _I_ select to do it (eg. startx or something similar. That being said, startx is usally the first command I give since I can have several xterms open). Again, these are my personal preferences and I apologize for the rant in the first line.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: uid problems

Post by catweazel »

perbh wrote: Thu Oct 04, 2018 3:48 pm I see where you are coming from (and I don't mean Aussie-land). Your solution was completely unknown to me, and I thank you for it. However, looking at your 'login.defs', it says, ever so clearly, that UID_MIN is for automatic uid-selection by useradd. It does not state that when giving a smaller value explicitly by useradd, that it will not be honoured. I haven't tried it out yet, but will (adjusting UID_MIN).
If nothing else it's a clue as to where to look next.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
gm10

Re: uid problems

Post by gm10 »

perbh wrote: Thu Oct 04, 2018 1:11 am The latest linuxmint-19 (64bit, xfce) will obviously NOT accept uid's less than 1000.
Obviously PEBKAC?

Code: Select all

$ sudo useradd i_like_pie -u 300
$ tail -n1 /etc/passwd
i_like_pie:x:300:1003::/home/i_like_pie:/bin/sh
What the problem is?

Suggest you use adduser though if you want your profile set up, because useradd won't do that for you - PEBKAC #2?
perbh

Re: uid problems

Post by perbh »

Oh yes, I could do that with useradd as well. However, after reboot and you choose a user to log in as - your i_like_pie will NOT come up - try it! I had /etc/passwd fine, filled in with appropriate groups (usermod) and the appropriate entries in the /home/{user}-directory. However, on reboot, the username would not come up. If you adjust UID_MIN (in /etc/login.defs), then the username comes up.

To my mind, this is wrong. If there is a legal entry in /etc/passwd and a home directory, the name should come up. That is how linux has always been - and that's how it should be. I called it 'windowization' and it was classified as rant (I did apologize) - and I guess it is. But whatever you call it - it is a 'dumbing down' to accommodate possible future users.

I have always had at least one computer running linuxmint for the past 10 years. It is not my main distro, but I have liked it sufficiently to keep it. Personally I am now leaning towards MX-linux which (although sharing the same background to some extent), do not give me these kinds of problems. New users start at uid=1000, but not only am I able to change the uid, I can also have new users (useradd) with uids well below the magical UID_MIN mark (in spite of having the same entry in /etc/login.defs). I guess the main difference is at login where MX-linux gives me an empty field to fill in, while linuxmint show you what usernames are available to you. Did I mention 'dumbing down'? (stepping off my soapbox)

I am sorry if I have stepped on anyone's toes with my ignorance of login.defs and will not post any more on this subject.
May the force be with y'all!
gm10

Re: uid problems

Post by gm10 »

You're not stepping on anybody's toes, it's simply your unnecessary rhetoric that sets the tone. It's hard to take you seriously ranting about dumbing down when several issues you rant about were clearly simply too complicated for you to figure out.

And on a more relevant note, did you take a look at your /etc/passwd and the amount of system accounts in there? If there was no separating between system and user accounts, all 40 or so would be listed on your login screen. Not doing that is not dumbing down, that's simple common sense. Yes, Windows does the same thing, because it's the right thing to do.

As I showed you, Linux Mint does not prevent you from adding the user with any ID you want. And nothing prevents you from logging into that user at a virtual console and starting your own X session there. I should think you would abhor graphical login windows, so that should be fine. Or modify the login window to remove the UID limitation - as you surely know we are open source.

But last but very certainly not least, if you like MX's manual login feature, nothing stops you from enabling that in Linux Mint. You can do that via the tool called ... wait for it ... "Login Window", that you find in the Mint menu. Too dumbed down to find? (stepping off your soapbox)
perbh

Re: uid problems

Post by perbh »

@gm10:
Ok - sorry again, I said I would post no more - but there you go.
Doing a "cat /etc/passwd | grep -v 'false$' | grep -v 'nologin$'" - you are left with exactly 2 entries that are not 'normal' users - 'root' and 'sync' which are easily removed as well. ie. Your 40+ system accounts disappears into fog!! So - instead of listing 'available users', why not give a field where you fill in the username you want? (as a default!). Just saying ... I can live with graphical login (though I don't have to like it - which I don't), but when it forces upon me non-unix/linux behaviour, it is my right to react (either by leaving it in the dust or accept the restrictions). I am preciously near to the first option, and if it hadn't been for 'catweazel', I would have - which would be no loss to you I am sure.

@catweazel:
Thank you for giving me a least a solution to my problem - I appreciate it!
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: uid problems

Post by catweazel »

perbh wrote: Fri Oct 05, 2018 7:32 pm @catweazel:
Thank you for giving me a least a solution to my problem - I appreciate it!
It's my pleasure. Though I didn't give you the solution, just a clue as to where the problem might have been.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
perbh

Re: uid problems

Post by perbh »

@gm10:
Just incase you come up with a better solution than my double grep ...

Code: Select all

egrep -v 'false$|nologin$|^root:|^sync:' /etc/passwd | awk -F: '{ print $1 }'
will give you all possible 'normal' users.
I still say that a field for entering username and password is a better solution, but each to his (or her) own liking.
gm10

Re: uid problems

Post by gm10 »

perbh wrote: Sat Oct 06, 2018 12:37 am will give you all possible 'normal' users.
Cool, suggest it to the Mint team https://github.com/linuxmint/slick-greeter/issues or even submit a pull request that adds this. I'd +1 it out of principle (might have to think about possible drawbacks first, but still). Look, I got no problem with you having an issue, just with your "the sky is falling, we're becoming Windows" rhetoric because you encountered a special interest shortcoming in the greeter that 99.99% of the users will never notice.

As I said, you set the tone. Next time just come "Hey guys, I've got a great idea how to make the login window better, what do you think?" -- you might be surprised how different the response will be. :)
perbh wrote: Sat Oct 06, 2018 12:37 am I still say that a field for entering username and password is a better solution, but each to his (or her) own liking.
I already told you how to enable that. Login Window tool from the Mint menu > check the box for Manual Login. Easy.
Locked

Return to “Other topics”