Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copying files securely between 2 hosts

Status
Not open for further replies.

gallows

Technical User
Jun 12, 2004
223
US
I need to come up with a way to copy files from one Solaris9 box to another via a cronjob. I wanted to use SCP and thought if I configured SSH with the "authorized_keys" I would be ok. But, from what I have read, it still requires a password. Since this will be running as a cronjob, I can't have a passwd. Anyone have any ideas on how I can do this?

Tks,
Gallows
 
Use rsync and ssh-keys...
Use ssh-keygen -t rsa to generate a key, place it on the machine you want to rsync to, etc.

On machine1
rsync -aurpovW --ignore-existing --delete root@machine2:/directorytoBackup /

On machine2
rsync -aurpovW --ignore-existing --delete root@machine1:/directorytoBackup /


perl -e 'print $i=pack(c5,(40*2),sqrt(7600),(unpack(c,Q)-3+1+3+3-7),oct(104),10,oct(101));'
 
You don't need rsync and you don't need a password with keys. Just specify a blank "passphrase" when generating the key pair.

Annihilannic.
 
What user are you trying to scp as? If you are using the root user, you will have to enable it in the config file settings.
 
Thanks Segment!! I appreciate the info. What does that perl line do?

Annihilannic - So I indeed can use SCP without a password. That is good to know. I'll Google keygen - never used it before:))

coffeysm - No, it can't be root. I will have to make up a new user.

Thanks again for all of your responses. I appreciate them.

Gallows
 
You will have to run ssh-keygen and specify no "Challege Password". You will then have to copy that id_xxx.pub to authorized_keys in the user's home directory. You might also have to check sshd_config to see if public keys are a valid way of authentication.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top