1843927 Members
1464 Online
110226 Solutions
New Discussion

Secure shell question.

 
SOLVED
Go to solution
Steven E. Protter
Exalted Contributor

Secure shell question.

I recently installed and started using Secure shell for everything I could. No more ftp, sftp, things like that.

I noticed there was an scp command which could replace rcp, which we use on our old systems but I will not allow on the new ones I'm getting ready to roll out.

I have .shosts set up valid on both servers, assuming the syntax is the same as .rhosts.

My question...

A command line script that will allow an automated job to use scp to copy a file between sytems and not prompt for a password. I think the basic premise might be impossible based on secure shell's reason for existance, but I'd like to here it from someone who has used it for more than 2 months.

Thanks.
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
5 REPLIES 5
Kellogg Unix Team
Trusted Contributor
Solution

Re: Secure shell question.

scp can be made to work w/o being prompted for the password once the public keys have been exchanged. Make sure when you generate keys, you don't put any passphrase.

If you are using OpenSSH from HP, look at the Release Notes for HP-UX Secure Shell A.03.10.002
http://docs.hp.com/hpux/onlinedocs/T1471-90003/T1471-90003.html

(yes, I am using it for more than 2 months!)

...Manjeet
work is fun ! (my manager is standing behind me!!)
Steven E. Protter
Exalted Contributor

Re: Secure shell question.

Woohoo!

You da man.

Thanks.
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: Secure shell question.

Oh yes. May I have a script example. I am either very lazy or very busy today(both).
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Kellogg Unix Team
Trusted Contributor

Re: Secure shell question.

Script example (assuming you want to put syslog.log from systemA to /tmp of systemB) -

#!/bin/ksh

source_host=systemA
source_dir='/var/adm/syslog'
source_file='syslog.log'
target_host=systemB
target_dir='/tmp'
target_file='syslog_of_systemA.log'

# Assuming ssh is installed and public keys are exchanged with null passphrases

scp ${source_dir}/${source_file} ${target_host}:${target_dir}/${target_file}

exit 0
work is fun ! (my manager is standing behind me!!)
steven Burgess_2
Honored Contributor

Re: Secure shell question.

Steve

Here are some FAQ's for SSH

http://www4.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000062683639#Q12

HTH

Steve
take your time and think things through