Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: What's behind the magic, WinSCP?

WinSCP does not so anything special, it just executes the command.
jj33

What's behind the magic, WinSCP?

I have a login to a remote machine after which I need to do a passwordless "sudo su".

I've been able to set this up in WinSCP and it works beautifully. I login as jj@remote-host and then, as per the Shell setting under Environment | SCP/Shell, it immediately does: sudo su - foouser and I'm able to transfer files as foouser. Awesome!

My question is, how does WinSCP achieve this? I'm trying to do the same thing from a shell, and I always get prompted with a password for foouser.

This is what I'm trying (just id at first, plan to figure out how to actually xfer files after I get that working):

ssh jj@remote-host 'sudo su - foouser -c "id"'

I'm thinking that since WinSCP can manage it, it's not an issue with permissions on remote-host but rather me not doing it right.