It's recommended, or at-least I would personally recommend you sync the group ID and user ID. There are many ways to do, and maintain this consistently - I'll go over three options.
Manually:
You can manually add the user to each host, the first SSH into both hosts then execute useradd -u 1500 testuser
replacing testuser
with a preferred username.
This will create a user with the GID/UID of 1500
, which you can confirm with id testuser
which should give you something like uid=1500(testuser) gid=1500(testuser) groups=1500(testuser)
SaltStack:
This will require some more learning if you're not familiar with SaltStack but here is a really simple state.
testuser:
user.present:
- fullname: 'Test User'
- uid: 1500
- gid: 1500
Reference: https://docs.saltstack.com/en/3000/ref/modules/all/salt.modules.useradd.html
(There are other options for configuration management, such as Ansible, Puppet, Chef)
Centralised:
There are a few options, but a popular one is FreeIPA which is a good all-in-one solution when it comes to centralised Linux authentication.
Of course, this option is more involved and will require you do some research - but there are tonnes of guides on how to install and configure this, such as this one.