2
1
If I try to switch the user using sudo su - kshitiz
it works, and doesn't ask me for any password.
But if I do sudo su kshitiz
it asks me for that user's password.
Why is this? I understand that hyphen loads that user's environment variables where's no hyphen keeps my own.
So then why does it ask me for target user's password when I want to switch while keeping my own variables, but not when I switch and load target's profile?
@Gravity
sudo -s -u
orsudo -i -u
doesn't work it asks for password. The only thing working issudo su -
– Kshitiz Sharma – 2016-05-05T11:49:30.987