Hi Everybody,
I am in urgent need of a solution.
I need to carry out SFTP activities through a shell script.
I have generated public and private keys as shown below:
Shell-Prompt$> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/sunone/.ssh/id_rsa): mary
Enter passphrase (empty for no passphrase):Mary had a little lamb
Enter same passphrase again:Mary had a little lamb
Your identification has been saved in mary.
Your public key has been saved in mary.pub.
The key fingerprint is:
af:fd:56:cb:47:b1:3b:aa:e6:dc:70:1d:d8:44:a9:40 sunone@devpopx-ukus
Next, the generated public key (contents of mary.pub) are copied to host's ~/.ssh/authorized_keys file
Having done the above, SFTP activities work perfectly when down at the shell prompt.
But, I am not able to do the same thru a shell script.
However, if I generate the public and private keys without any passphrase (null passphrase, that is), the script works fine.
Can anybody suggest how to go about doing SFTP in a shellscript, when a passphrase has been specified for the generated keys.
Or is it not possible to implement this through shell-scripts??
Please Help!!