I have a Windows Server 2003 box and it is using
psftp to connect to a remote linux machine and download files every hour.
I have two main challenges with this machine:
Scheduled tasks are currently set to run as a user on this box, which I believe requires storing the user's password in the task scheduler. However when the user's password changes the task fails to run. I'd like to have this task always run regardless.
- I believe the solution to the first problem is to have the scheduled task run as
SYSTEM. Is that correct? If so, how do I set this up? Just type
SYSTEMin the "Run as" box? And do I need to set a password for
SYSTEMbecause I believe I tried with no password and it said the job did not run because the password was incorrect. Perhaps I am doing this wrong.
Putty requires that the remote key for a server is stored in the registry to verify the server's authenticity. However this seems to be stored on a per-user basis and so if I switch the script to run as a different user it seems the user must run the script interactively the first time so that the key is stored in the registry.
Instructions on the putty website mention that keys should be added to the following registry location:
But judging from "HKEY_CURRENT_USER" I don't think that will be for the
SYSTEM user. If I do set up this task to run as
SYSTEM, how can I make sure that the appropriate key is stored in the registry for the host? I don't mind manually adding it (there is a perl script to convert a known_hosts file), but where should it go?
myscript.bat just uses psftp.exe to pull files from a remote server. Nothing special. There is no flag to skip checking authorized hosts, and the folks at putty mention that this would be a bad idea anyhow.