I also tried to put sudo command as first statement in the script launched by
winscp.com user:pwd@host /script="transfer.txt":
with transfer.txt content as follows:
call sudo su - otherUser
mv *.jar %1%
put *.jar ./
getting this result:
Automatic actions are disabled when URL address is provided on command-line.
Searching for host...
Connecting to host...
Using username "user".
Authenticating with pre-entered password.
Starting the session...
Error looking up user groups.
failed with return code 127 and error message
groups : command not allowed.
Reading remote directory...
Instead, if I try doing the same with
and then manually writing the command "call sudo su - otherUser" I get this error after 15 seconds delay:
Host is not communicating for more than 15 seconds. Still waiting...
Warning: Aborting this operation will close connection!