Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Automating scp within script without passphrase

From: Mak, Andrew <Andrew.Mak(at)team.telstra.com>
Date: Tue Jan 14 2003 - 20:49:17 EST


Hello ALL,

I am curious anyone has encounter the following and how to resolve / get round it.

I am basically setting up a scp between hosts within a script. As a result, I did the following

1) generate an empty passphrase with the command 'ssh-keygen -t rsa -f /backup/backup-key -N "" '
2) copy the public key to the authorized_keys file on the remote machine
3) on the local machine, specify the scp command with the key 'scp  -i  /backup/backup-key  /tmp/fileA  remoteHost:/tmp/fileA'

The above works as expected without any problem. However, the key basically allows anyone who has access to it to login to the remote host without any pass word / phrase. Looking up man pages on sshd, there is an option which I can specify command(s) to be run, in other words, whoever using this key is restricted to running the specified command(s) only. I tried this by specifying testing scripts on the remote host and it works. However, there seems to be a problem when specifying scp as the command. If no key is specified, it ask for the passphrase, if the key is specified, it runs into recursive calls (use in loose sense).

Could anyone shed some light into this. Many thanks in advance

Regards
Andrew Received on Fri Jan 17 12:18:26 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:52 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library