6

I've been trying to set this up, but I can't find a solution. It's neccessary, because the machine Ubuntu is on is a Macbook and needs to have access to the files of the Mac user. Is there any way to get this to work?

  • How about usermod -u UID username – Achu Nov 02 '12 at 18:55
  • No you don't want to renumber the user. this would simply remove it from LightDMs display as well. What you are looking for is some parameter of the lightDM configuration in your /etc or maybe /etc/xorg directory. I don't have lightdm installed currently, so I can't tell you which one. – Paul Hänsch Nov 02 '12 at 18:59
  • 2
    Oh wait, I think what Achu meant was modifying the MacOS user. This would probably be the cleanest solution. Don't forget to chown all the files of the Mac-User afterwards, so they belong to the new UserID. – Paul Hänsch Nov 02 '12 at 19:01
  • Ah, thanks, I didn't think of doing that. I'll try that instead then, since it appears to be the cleanest. Is there any easy way to chown all the files on the Mac to the new UID? –  Nov 02 '12 at 19:03
  • Hm, that's not the command on OSX, any other ideas? –  Nov 02 '12 at 19:43
  • If its for file access, what about mounting with ACL? – Takkat Nov 02 '12 at 20:36
  • Will that work with HFS+? Also, this doesn't seem to be of any use, since the drive has got OSX on it installed and I don't won't to mess with it so much to potentially screw up my friend's machine. I'm trying to get him to switch to Ubuntu, not be turned off Linux forever. –  Nov 02 '12 at 21:30
  • it appears as though there is currently no real way to make this work. see the bug report https://bugs.launchpad.net/ubuntu/+source/accountsservice/+bug/1300514 for a temporary fix. – krumpelstiltskin Jun 19 '15 at 09:14

2 Answers2

6

Lightdm has the config file /etc/lightdm/users.conf which you can edit to set a minimum UID. The default is 500. It also sets hidden users and certain shells that if a user has are hidden. Try editing that file and restarting lightdm.

[UserAccounts]
minimum-uid=500
hidden-users=nobody nobody4 noaccess
hidden-shells=/bin/false /usr/sbin/nologin
Jorge Castro
  • 71,754
mfisch
  • 3,643
5

You will probably also want to change the defaults for adduser & useradd, to create new users with UID starting at 500.

Two files need change, as:

/etc/login.defs

...
# Min/max values for automatic uid selection in useradd
#
UID_MIN            500
UID_MAX          60000
# System accounts
#SYS_UID_MIN       100
#SYS_UID_MAX       499
...
# Min/max values for automatic gid selection in groupadd
#
GID_MIN            500
GID_MAX          60000
# System accounts
#SYS_GID_MIN       100
#SYS_GID_MAX       499

/etc/adduser.conf

...
# package, may assume that UIDs less than 100 are unallocated.
FIRST_SYSTEM_UID=100
LAST_SYSTEM_UID=499

FIRST_SYSTEM_GID=100
LAST_SYSTEM_GID=499

# FIRST_[GU]ID to LAST_[GU]ID inclusive is the range of UIDs of dynamically
# allocated user accounts/groups.
FIRST_UID=500
LAST_UID=29999

FIRST_GID=500
LAST_GID=29999
  • Why so? The newly created users are in no way guaranteed to match the new ones on the Mac, and either way it's a single-user laptop.

    Thanks though, I'll remember this for future use, and perhaps it'll help some other people when they find this question and answers.

    –  Nov 11 '12 at 21:47
  • +1 Thanks! My /etc/lightdm/users.conf had minimum-uid=500 but still would not show users whose uid was less than 1000. – copper.hat Sep 29 '13 at 21:15