17 May, 2021 #Technology

Password less switch to another User Account

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

  1. su
  2. sudo

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.

sudo visudo

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

0 Comments on Password less switch to another User Account

Leave a Comment

Your email address will not be published. Required fields are marked *

You Might Be Interested In