I need to scp some .xml files (of duration April-May 2016) from a Solaris server (Server A) to a Linux server (Server B) where the Solaris server is the home directory where the script is written and will be executed.
I have written the below script for this-
#!/bin/sh
ssh [email protected] touch --date "2016-04-01" /tmp/start.tmp
ssh [email protected] touch --date "2016-05-31" /tmp/end.tmp
for i in `find /home/hs/demo*.xml -type f -newer /tmp/start.tmp -not -newer /tmp/end.tmp`
do
scp [email protected]:$i [email protected]:/data/Output
done
But after executing the script from server A it is prompting me for password (which I don't want to happen, as I need the Solaris to automatically scp files without human intervention)
And for doing scp I have created keys using command "ssh-keygen -t rsa" in Solaris server (Server A- 10.20.14.49) and have copied the public key to the Linux server (Server B- 10.24.21.11).
But still after executing the script from server A it is prompting me for password, and so I have created a config file in Server A under /home/hs/.ssh, and below are its contents:-
Host oa
User dev
HostName 10.24.21.11
IdentityFile ~/.ssh/my_ssh_key
But still Solaris (Server A) is prompting me for password.
server
? And your user account on 10.24.21.11 calleddev
?