Topic "use winscp as commandline ftp client throw a proxy"

Author Message
therapie

Guest


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?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Please read FAQ. If that does not help, come back.
_________________
Martin Prikryl
therapie

Guest


prikryl 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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Sorry, I do not understand. So please try again to explain what you are after in more details.
_________________
Martin Prikryl
Guest




prikryl 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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
What is a difference between entering the password on command-line and in the INI file?
_________________
Martin Prikryl
therapie

Guest


prikryl 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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
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.
_________________
Martin Prikryl
therapie

Guest


prikryl 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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
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.
_________________
Martin Prikryl
therapie

Guest


prikryl 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
R.

Guest


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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
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 Prikryl
R.

Guest


prikryl 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!
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License