Change user UID


#1

Hello!

I know it’s not recommended, but to setup a new UCS server and integrate with several environments where there are a lot of files owned by existing users (who will be mapped into UCS), I need to change the UID of some UCS users who have already been setup with the incorrect UID (i.e. it doesn’t map to existing UIDs on older systems).

I believe it’s possible to make this change using the command line client on the UCS server - correct? Are there any potential issues which may result if this is done?

Thanks!


#2

Just to clarify - this is the parameter uidNumber in LDAP in the UCS system

This is the output when attempting this via the UDM:

“Value may not change. : uidNumber”


#3

Hi,

changing the UIDnumber is not possible by default even on the commandline.

root@poc:~# udm users/user modify --dn=uid=otto,cn=users,$(ucr get ldap/base) --set uidNumber=222222 Value may not change.: uidNumber

The Wiki-page Migrate Existing Samba 3 Installations to UCS 3 with Samba 3 shows an example hot to define a different UIDnumber during the creation of an user object.
When using not the default behaviour for the creation of the uidNumber you should at least notice that it should not collide with existing gidNumbers (see [bug]39373[/bug].

Best Regards,
Dirk


#4

Thanks for the reply Dirk.

When the accounts in UCS were set up, it was planned to migrate to using new posix UIDs across all the linux hosts - so users were created with new UIDs in UCS. However, it subsequently turns out that there are so many files which need to be found (the long part - linux find running for hours!) and chown’ed that it would be preferable to change the uidNumber within UCS.

If UDM can’t do this - would direct manipulation with ldbedit & ldapmodify be an option?

Thanks!


#5

It seems to be the only chance, but I have no practical experience with this in UCS. The only thing I know is that a customer changed the numerical IDs on Linux before migrating to UCS.


#6

I’ve changed the uidNumber via ldapmodify - it seems to have worked ok.

Hopefully it doesn’t cause any issues!


#7

have a look at this script:


#8

Many thanks for pointing me to this - very useful info here.

I’m glad Google Translate is better at translation that I am - unfortunately my German is a bit rusty!


#9
            _
           /(|
          (  :
         __\  \  _____
       (____)  `|
      (____)|   |
       (____).__|
        (___)__.|_____