In this post you will learn how to configure a linux machine to allow a password less switch to another user account. To switch user accounts following commands are typically used
Both these commands would require user to input password. #1 would need password of target user switching to, and #2 would require password of current user. There are some configuration changes that can be to support password less switch with “sudo“
Let’s look at an example tuxuser switching to another account tuxadmin.
Look for the below lines
# Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL
add the below and save the file.
tuxuser ALL=NOPASSWD: /bin/su - tuxadmin
Test and confirm these work