1833883 Members
1855 Online
110063 Solutions
New Discussion

scp authentication

 
akarayil
Frequent Advisor

scp authentication

Hi,
In an oracle backup script which is scheduled to run by oracle user (rx7620,OS11.23), we use scp to copy backed up files to a linux system for testing purpose.Recently we change the package to alternate cluster node. After that, using cron scp is not working because it is asking the password of remote system.
So,I generate ssh key for oracle user,copy public key to remote systems authorized_keys file in oracle users home directory.
In hp server, enable ssh-agent for oracle user through .profile file and adding passphrase[(using ssh-add cmd)need to do each time user logs in], I can login without passwd. But how can I do this through a cron job?
I don't know how it was running previously.
2 REPLIES 2
OldSchool
Honored Contributor

Re: scp authentication

1) "Recently we change the package to alternate cluster node. After that, using cron scp is not working because it is asking the password of remote system...."

Perhaps the easiest solution for the above is to generate new keys for the oracle user on the "alternate server" and add them to the authorized keys file on the oracle server.

2) "So,I generate ssh key for oracle user,copy public key to remote systems authorized_keys file in oracle users home directory. In hp server, enable ssh-agent for oracle user through .profile file and adding passphrase[(using ssh-add cmd)need to do each time user logs in], I can login without passwd. But how can I do this through a cron job?
I don't know how it was running previously."

Typically, you wouldn't use a "pass phrase" for the user in the cron job. Instead you rely solely on the security provided by the keys themselves. There may be other ways around this. If so, I haven't used them.
Adam W.
Valued Contributor

Re: scp authentication

I also think new keys for the acocunt would be the "key" to a solution. (NO I am not trying to be funny) I ran into a similar problem, specifically with cron and a "new" account, new keys is fast and relatively simple. Go for it. Old School is always a good source, make sure you listen to his advice.
There are two types of people in the world, Marines and those who wish they were.