use winscp as commandline ftp client throw a proxy

Advertisement

therapie
Guest

use winscp as commandline ftp client throw a proxy

hello
I like the xml logs of winscp so I would like to use it for ftp transfert but for ftp
I go throw a proxy

a standard command line allow me to do this

but with winscp I can only do this with ftp//proxy witch not allow commands

if I try the syntax
winscp /console /command "open ftpuser@proxyuser:ftppss@proxypass@proxysserver
I have a network error ftp protocole is not used

any help?

Reply with quote

Advertisement

therapie
Guest

Re: use winscp as commandline ftp client throw a proxy

martin wrote:

Please read FAQ. If that does not help, come back.

done yet before posting
nothing about this particularity
Faq tells about the url mode but I need to send commands

Daniel

Reply with quote

martin
Site Admin
martin avatar

Re: use winscp as commandline ftp client throw a proxy

Sorry, I do not understand. So please try again to explain what you are after in more details.

Reply with quote

Guest

Re: use winscp as commandline ftp client throw a proxy

martin wrote:

Sorry, I do not understand. So please try again to explain what you are after in more details.
my question is when I use ini file and I do not want to store the password in the ini file
how can I enter credentials?
her is my exemple

ftpsession.ini
---------------
[Sessions\ftpsession]
HostName=proxyname
PortNumber=21
FSProtocol=5
FtpPasvMode=1
UserName=ftpuser@proxyuser@ftpurl
----------------
when I use the command line

winscp.exe /console /command "open ftpsession" /ini=ftpsession.ini
winscp prompt me to enter the password if I enter it manualy in the console it works and I can after enter ftp commands
but what I need is to enter the password and the ftp commands by command line and it seems not to be possible


winscp.exe /console /command "open ftpsession" "ftppassword@proxypassword" "dir" "get*" /ini=ftpsession.ini

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: use winscp as commandline ftp client throw a proxy

What is a difference between entering the password on command-line and in the INI file?

Reply with quote

therapie
Guest

Re: use winscp as commandline ftp client throw a proxy

martin wrote:

What is a difference between entering the password on command-line and in the INI file?

Hello
I am not allowed to write an uncrypted password in a file

my process is that I have a crypted password in a file my script decrypt it and send the uncrypted password by command line to winscp

Reply with quote

martin
Site Admin
martin avatar

Re: use winscp as commandline ftp client throw a proxy

therapie wrote:

I am not allowed to write an uncrypted password in a file
You can store it encrypted in the INI file too. Well the encryption is not the best. Though may not be worse than the one you are going to use for your file.

Reply with quote

therapie
Guest

Re: use winscp as commandline ftp client throw a proxy

martin wrote:

therapie wrote:

I am not allowed to write an uncrypted password in a file
You can store it encrypted in the INI file too. Well the encryption is not the best. Though may not be worse than the one you are going to use for your file.

why not using your's but the process of changing the password is done by an other team so I can not know if the password has been changed when I launch the script
so it must be able to crypt the password in the ini file by command line. does that can be done?

for information I use the data protection api for encryption

Daniel

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
38,659
Location:
Prague, Czechia

Re: use winscp as commandline ftp client throw a proxy

therapie wrote:

does that can be done?
Sure. But you would need to implement the encryption algorithm WinSCP is using. You can look it up in the source code.

Though still, I believe that your idea of passing password on command line is safer than storing it into a file is false. In both cases you need to prevent physical access to the machine to be safe. You may not know that command-line used to run an executable (so including your password) is accessible to all other processes running on the host.

Reply with quote

therapie
Guest

Re: use winscp as commandline ftp client throw a proxy

martin wrote:

I believe that your idea of passing password on command line is safer than storing it into a file is false.

Hello, at this point this is not the issue for me
the issue is that I can not have a full integrated solution as to create the encrypted password I must connect manualy to winscp
anyway

it is possible to use winscp in command line for ftp by using the ini file
it is possible tu use with the same script winscp for sftp protocole too
your solution of xml logs is surely the option that will make me use winscp

if one day you integer the possibility to send the password by command line for ftp as you do for sftp winscp will be the perfect tool to create a universal protocol transfert script

Reply with quote

R.
Guest

sftp behind a proxy using a bat script

Hi, Martin.

I'm new to using WinSCP to sftp files.

My .bat script is working fine if not using a proxy server as a go-between.

I need help in making it work when behind a proxy server. If i use the WinSCP GUI and set the site there, including the proxy details, when i pick up the session by
*open user@ftpsite* in my script it works fine.

My question is can i script the proxy server details in the .bat file? If so, what would be the correct format of the open command?

Thank you in advance for your help.

R.

Reply with quote

Advertisement

R.
Guest

Re: sftp behind a proxy using a bat script

martin wrote:

R. wrote:

My question is can i script the proxy server details in the .bat file? If so, what would be the correct format of the open command?
Please read documentation:
https://winscp.net/eng/docs/rawsettings

If that does not help, come back.

Martin, many thanks for your guidance, all sorted out! Thank you!

Reply with quote

jibanez
Guest

works!

That works for my

scp:
cmd://"C:\Program Files (x86)\WinSCP\WinSCP.exe" sftp://{USERNAME}:{password}@{URL:HOST} -rawsettings ProxyMethod=2 ProxyHost=localhost ProxyPort=8888

BR,
JI

Reply with quote

Advertisement

You can post new topics in this forum