TecMint published a tutorial about how to switch (su) to another user account without password.
How to Switch (su) to Another User Account without Password
In this guide, we will show how to switch to another or a specific user account without requiring a password. For example, we have a user account called postgres (the default PostgreSQL superuser system account), we want every user (typically our PostgreSQL database and system administrators) in the group called postgres to switch to the postgres account using the su command without entering a password.
How to Switch (su) to Another User Account without Password