Can I use session rawsettings shell option to change default shell AND alter sudo?

Advertisement

Ayudo98
Joined:
Posts:
5
Location:
US

Can I use session rawsettings shell option to change default shell AND alter sudo?

Hello,

I see it is possible to change the default shell Bash and also to alter the user I am logging in (known as su).

https://winscp.net/eng/docs/faq_su
https://winscp.net/eng/docs/ui_login_scp#shell

my question is: can I use both at the same time? if so, what is the syntax?

I currently using this:
$sessionOptions.AddRawSettings("Shell","/bin/ksh")
which works great.

I want to something like this:
$sessionOptions.AddRawSettings("Shell","sudo -s MyOtherUser")

If I add it two times, the system complains that there is a duplicate.

Regards, Raul.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
34,300
Location:
Prague, Czechia

Re: Can I use session rawsettings shell option to change default shell AND alter sudo?

This should do:
sudo -s MyOtherUser /bin/ksh
Though it may need an additional sudo configuration.
Check sudo manual:
https://linux.die.net/man/8/sudo

Reply with quote

Advertisement

You can post new topics in this forum