> Greetings,
>
> I'm in a situation where I need to copy files from one host to another
> via a cron job. Automated FTP is out, due to the need for the
> communication to be encrypted. Is it possible to automate scp or sftp
> to do this? The only problem I can see so far is having to spec the
> password somehow, and I'd rather not have a password or passphrase
> stored in a file..
What you can do is to start an ssh agent as such:
ssh-agent > .ssh/ssh-agent-init
Add this line to your .bashrc or equivalent:
eval `cat $HOME/.ssh/ssh-agent-init`
Then start a new shell, and do ssh-add.
As long as the ssh-agent-process isn't killed, every shell script you now
start will be able to do public-key authentication. For this to help, of
course, public key authentication alone (i.e. not both public key and passwd
required) must be sufficient for login.
If ssh-agent is killed or incapacitated, you'll need to recreate
~/.ssh/ssh-agent-init and add keys again.
Of course, there are security issues with having an ssh-agent process
running indefinitely on the system. If you don't trust root, for example, it
may not be smart. On the other hand, it is better than storing the
passphrase in cleartext.
--
Åsmund Skjæveland ([EMAIL PROTECTED])
PGP signature