11 Oct
2021
11 Oct
'21
10:20
On Mon, 11 Oct 2021 11:51:43 +0200
"jdd@dodin.org"
Le 11/10/2021 à 09:27, Per Jessen a écrit :
su -s /bin/sh news
curious, the result is not exactly the same (not same prompt)
#sudo -u news -s /bin/bash news@ns507557:/root> exit
news@ns507557:/root> whoami news
ns507557:~ # su -s /bin/sh news sh-4.4$
sh-4.4$ whoami news
It knows whether it was invoked as 'sh' or 'bash' and presumably doesn't read bash-specific config files when invoked as 'sh'.
jdd