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-


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`
scp [email protected]:$i [email protected]:/data/Output

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- and have copied the public key to the Linux server (Server B-

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
IdentityFile ~/.ssh/my_ssh_key

But still Solaris (Server A) is prompting me for password.

  • On target server add your public ssh key in ~/.ssh/autorized_keys Commented Sep 28, 2016 at 12:52
  • 1
    There may be a problem with permissions on the .ssh directory, or its files - Solaris can be more strict that Linux by default on this. Could you check/provide verbose scp output to see if key is being considered / rejected?
    – ocurran
    Commented Sep 28, 2016 at 13:49
  • Is your user account on really called server? And your user account on called dev?
    – MikeA
    Commented Sep 28, 2016 at 16:11

1 Answer 1


you may want to use this command instead, if it is available:

ssh-copy-id [email protected]

This will transfer your public key to the remote server and handle the authorized key process for you.

  • This command worked perfectly for me, but the key that was inserted on the target server looks nothing like either the public or private key generated by ssh-keygen. So what is this key that is copied? (Admittedly I was working from Linux to Solaris 8, but I expect the rules should be the same.)
    – Sinc
    Commented Oct 30, 2018 at 20:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .