Automate script without storing password in parameters

Advertisement

zfozz
Joined:
Posts:
5
Location:
Ohio, United States

Automate script without storing password in parameters

I am trying to automate (scheduled daily) a simple script to download some files from my FTP to my computer using SFTP. I have a stored session that I can use to connect manually successfully. I've managed to create the script and it functions properly when I run it. See below:

option batch on
option confirm off
open user:password@site.org
cd /mydirectory
option transfer binary
get file.txt c:\
close

I would like to avoid having to put my plain text password right in the script. Is there a way to recall my stored session with my saved password in it instead?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Automate script without storing password in parameters

zfozz wrote:

Is there a way to recall my stored session with my saved password in it instead?
Sure, "open stored_session_name". Please read documentation.

Reply with quote

zfozz
Joined:
Posts:
5
Location:
Ohio, United States

Solved

Thanks. I saw that in the documentation, but I was typing the name of the stored session incorrectly. I was simply putting:

open site.org

It was prompting me for my user name. I should have been putting:

open username@ftp:/site.org

Thanks for your help!

Reply with quote

martin
Site Admin
martin avatar

Re: Solved

That does not make any sense.
You simply put there name of your stored session as is. "username@ftp:/site.org" looks like a nonsense. Of course unless your stored session has such name indeed.

Reply with quote

zfozz

Weird Login Name

I'm not sure why I have to type all of that. All I know is that it works. I emailed you a screen shot of my Login setup, if you care to look.

Reply with quote

Advertisement

zfozz

Resent Email

I sent it to winscp zero nine at prikryl dot cz. 5/5/09 9:16 AM EST. Subject is "WinSCP Weird Login Name Screenshot".

I just resent it with the same subject name. It has a .jpg attached (screen shot).

Reply with quote

martin
Site Admin
martin avatar

Re: Resent Email

All I can see on the screenshot is that you've made folder for sessions with name "xxxx@ftp:". I guess you've did it by mistake by naming your session "xxxx@ftp://domain.xx". WinSCP interprets the slash as folder separator, creating the folder implicitly. Though naming the session is completely free. Of course by naming the session as you did, you only make your life more complicated :-)

Reply with quote

Advertisement

You can post new topics in this forum