0

I m trying to pull a file from a Solaris server to my Linux server and I did it successfully by using scp.I want to run this below command as a cronjob, How can I save password for this automation for Solaris to linux file transfer?

scp -r root@serverA.com:/usr/abc/* /home/def/
Password:

But every time it prompt for password. I have already generate a set of public and private ssh keys on my machine for my user with:

ssh-keygen

And copy my public key to the remote host:

ssh-copy-id root@serverA.com

Note: I successfully run it at cron when both servers are linux server. Facing problem for Solaris server to linux server.Here my local server is linux and remote one is Solaris server.

  • Run a copy of sshd on the Solaris server in debug mode and see what it says. This and some other troubleshooting steps are in this question: unix.stackexchange.com/questions/180858/… – BowlOfRed Feb 18 '16 at 8:21
  • what do you see in logs? If you try to connect and get rejected, server should store the reason for rejecting. If not, increase verbosity in sshd_config, restart sshd and repeat. – Jakuje Feb 18 '16 at 13:11
0

If it works from command line with the keys, then one situation that I see is that you are running cron with another user than the one to pull the files.

you can change your command to:

ssh -i <ssh_private_key> -r root@serverA.com:/usr/abc/* /home/def/
0

I trust you have had a look at this:

http://docs.oracle.com/cd/E19253-01/816-4557/sshuser-33/index.html

Also, see the man page for you ssh client, you might have to force protocol version 1.

For a start, from what I understand, it does not even work in interactive mode. try -v flags, start with one

ssh -v root@serverA.com then, if that does not tell you anything

ssh -vv root@serverA.com

as a last resort:

ssh -vvv root@serverA.com

Note that I always found the issue using just one -v.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.