1

I have users defined in AD but because of some overrides, I have to add those accounts in my local /etc/passwd. Precisely, I want to assign a user a different GID then it is defined in AD.

I want to login with local user ( from /etc/passwd ) and with the use of the password from AD. When there is only local user defined and no password in /etc/shadow it doesn't work.

When I define the password locally with passwd username and it gets stored to /etc/shadow i can log in. If I try and remove the local user from /etc/passwd then I can login but without those overrides which I want to have.

I have tried adjusting the nsswitch.conf order and pam common-auth ( plus as suggested here) but nothing worked.

Has anyone any idea how to achieve this? LOCAL USER with AD PASSWORD Distro: Ubuntu

1
  • not directly related, you can add to AD user a secondary group by editing /etc/group
    – Archemar
    Jul 25, 2022 at 12:12

1 Answer 1

2

Found out the solution!

One need to create the /etc/shadow entry with passwd user and then later manually change the password hash to *

If the password field contains some string that is not a valid result of crypt(3), for instance ! or *, the user will
       not be able to use a unix password to log in (but the user may log in the system by other means).

/etc/passwd:

user:*:226860:45253:test.user:/home/user:/usr/bin/bash

/etc/shadow

user:*:19198::::::

Important part here is the user may log in the system by other means - so I tried it and it works!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .