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 [email protected]:/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 [email protected]

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.

2
  • 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, 2016 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, 2016 at 13:11

2 Answers 2

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 [email protected]:/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 [email protected] then, if that does not tell you anything

ssh -vv [email protected]

as a last resort:

ssh -vvv [email protected]

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

You must log in to answer this question.

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