2

We have several Linux machine (running various versions of Fedora and CentOS, but that should not be relevant) with local users. Most of those local users are the same login name but might have different UID/GID based on when and by whom they were created. We want to sanitise this state of affair and settled on FreeIPA

How can I map the already existing local Linux users to the FreeIPA user?

Just to be extra clear: Given I have a local user called abc on machine ook and a FreeIPA user called abc, and ook is set up as a FreeIPA host with access for ook, when I ssh into ook as abc (via ssh abc@ook) then I am prompted for the password from FreeIPA. Better yet since I defined a public key for user abc I should log in without a password provided that I am authenticated and authorised on ook. The ~abc is whatever was present in the local account (before FreeIPA was introduced) and not another account with the same login name but different UID/GID.

Is this possible?


Clearly, this is related to https://serverfault.com/q/754922/132934.

  • I ended up creating new accounts, which was a real pain. So I'd like to see a good solution here. – Michael Hampton Feb 9 '16 at 15:30
  • @MichaelHampton: Creating new accounts is a show stopper for me! No one will accept that. – Sardathrion Feb 9 '16 at 15:36
  • Yuo can try to use "ID View" to map for IPA users UID and GUID of lokal users on specified host. – Sergiy Nov 29 '16 at 14:49
2

I don't think there is any magic here: at some time you will have to ensure UID/GID uniqueness and alignment across all servers then including in LDAP. In case alignment is not achieved then you amy have unexpected permissions. How to achieve this?

  • collecting all UID/GID from all /etc/passwd and /etc/group
  • mesure difference and conflicts if any (including comparison with existing UID/GID in LDAP)
  • define target UID/GID for accounts that are not aligned
  • usermod / grpmode to change UID and GID
  • chmod and chown when needed

Once aligned everywhere, as servers are configured to rely on LDAP (PAM and NSS), local accounts and groups are no more required and should be removed, IMHO.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.