Dear Experts,
I am writing a batch script to transfer files from server AA to BB without prompting for password. Already, ssh keys have been generated in BB and public key of BB has been stored in AA as part of some other project requirement. So, I thought of reusing this. I can now transfer files from AA to BB using any of the below options.
- sftp from BB to AA and then "mget" the files
- run scp in BB to transfer files from AA to BB
However, in both these cases, I have to connect from BB to AA. But due to some internal requirements, my script has to run only in server AA and not BB. When I try to run sftp/scp in my script in server AA, it is prompting for password. I understand that I can create SSH keys in AA and then store the public key in BB. But is there a way to avoid this since an SSH connection already exists from BB to AA.
Saw many posts in unix.com and google too. Doesn't seem to narrow down on what I need. Please assist.
Also, why is it that I am able to connect only from BB to AA and not the other way around. I am guessing this is due to some restrictions setup while creating the keys. Please clarify. Details below.
OS of both the servers:
HP-UX 11.11
public key (id_dsa.pub) in server BB:
ssh-dss............................... userid@BB
Thanks heaps.