passwd -l user

to disable login

That will lock the user account. But you’ll still be able to

su - user

but you’ll have to su - user as root.

Alternatively, you can accomplish the same thing by prepending a ! to the user’s password in /etc/shadow (this is all passwd -l does behind the scenes). And passwd -u will undo this.