[sudo-users] sudo to fully switch to another user

Todd C. Miller Todd.Miller at sudo.ws
Wed Dec 6 20:19:00 MST 2017


Is there a reason you cannot run "sudo -i" instead of "su -"?
That will cause sudo to change the cwd to the target user's homedir
and run a login shell.  You would have to enumerate the shells you
want to allow in the rule but that doesn't seem unreasonable.

For example:

millert at linux-build:~$ pwd
/home/millert
millert at linux-build:~$ sudo -i 
root at linux-build:~# pwd
/root

 - todd


More information about the sudo-users mailing list