Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources: Active Threads
Viewing all articles
Browse latest Browse all 8411

Very Old FTP, Need Password Encripted

$
0
0

We have a very very very old mainframe here and the FTP that can pull from it is also old and I need to pull a couple of files from it on a daily basis using PowerShell (PS.) This is not a problem, it’s very easy.  The problem is I can’t encrypt the password because the only way I can figure out how to get the files is to have PS call a text file that fills in the FTP info.
ftp -s:C:\POWERSHELL\LIVESCRIPTS\FTP.txt

The text file simply has…
open 123.456.78.90
AccountName
Password123
get 'taz.arc.tape.daily' E:\DAILY\DAILY1\DAILY
quit

Note that the target is ‘taz.arc.tape.daily’ and has periods instead of backslashes.  This is because there really is not a path, the full file name is ‘taz.arc.tape.daily’ but when I pull it down it becomes simply ‘daily’

This opens the FTP, logs on and pulls the file from the FTP to the location I want and closes the FTP.  It works perfectly except the fact that anybody can open the text file and see the password.   I know how to encrypt the password in PS but what I need to know is… Ether how to encrypt the password in the text file or how to have the password be a variable in PS that can be used at that spot in the text file.

One solution I came up with is to have PS make the text file and delete it at the end of the script.  This is not perfect because somebody could grab the text file before PS has the chance to delete it.  It is at least making it harder for someone to get the password but I would like it to be a lot more secure than that.

Any help is appreciated.  Thank you, -Dan


Viewing all articles
Browse latest Browse all 8411

Trending Articles