You can try the below steps:
passwd -l user
The command will lock the user account in case of LDAP authentication, you do not need user on server. And passwd -u user command can undo that.
You can try the below steps:
There is one more way to achieve that, It can be accomplished by adding a ! before the user's password in /etc/shadow,
I hope it will work for you.