For a special purpose it seems like I need to know the UID (user ID) of my guest accounts.
As guest accounts are created and (usually) removed automatically whenever one is needed, the UIDs are not fixed but assigned dynamically. If I observed it correctly, they take the first free UID that is greater than 100, but I am not sure.
However, I need to know for sure that all guest accounts and only guest accounts, no other users, are in a specific UID range, for example in range 800-899 which should be free and is still invisible because it's lower than 1000.
How can I set my Ubuntu 15.10 machine (with Unity DE) up so that it assigns all future guest accounts UIDs in that specific range and that no other users may get into it?
You're free to suggest other different solutions that help me solving my linked problem as well.
man adduser, I found the parameters--firstuidand--lastuidwhich can be used instead of--uidto determine a range of UIDs. – Byte Commander Nov 17 '15 at 11:37lightdm.confdo you mean? None of the files on my system named like that contained a line withguest-account-script=or similar. – Byte Commander Nov 17 '15 at 11:46/etc/lightdm/lightdm.conf? – A.B. Nov 17 '15 at 11:49/etc/init/lightdm.conf, but that doesn't contain such a line. – Byte Commander Nov 17 '15 at 12:02/usr/sbin/guest-accountand edited theadduser-line toadduser --system --firstuid 450 --lastuid 499 --no-create-home --home / --gecos $(gettext "Guest") --group --shell /bin/bash $USER. Now trying that out... – Byte Commander Nov 17 '15 at 12:16/usr/sbin/guest-accountdid not affect anything. After two reboots, I'm still getting guest account UIDs around 120. – Byte Commander Nov 17 '15 at 13:30--firstuidand--lastuidapply to normal users. You may want to drop the--systemoption (untested). – Gunnar Hjalmarsson Nov 17 '15 at 14:06sudo adduser --system --uid 1024 --no-create-home --home / --gecos $(gettext "Guest") --group --shell /bin/bash barworks as expected as single command. – A.B. Nov 18 '15 at 07:25