Home > Archive > Linux/Unix > January 2003 > SCP or SFTP shell script





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author SCP or SFTP shell script
ccieToBe

2003-01-23, 2:34 am

Is there any way to include a password parameter in shell scripts that call either SCP or SFTP? Google and some experimentation haven't turned up much. I'm hoping to synchonize my DNS servers using something more secure then zone transfers. All the DNS servers run FreeBSD 4.7.
Mr. Linux Guy

2003-01-23, 5:47 am

Did you try using RhostsRSA authentication? This will allow you to avoid typing a password for each session.

To do this, create a ~/.rhosts or a ~/.shosts file under your home directory on your machine. Within .rhosts or .shosts, list all the fully qualified local hosts you will use to connect to NAS systems. An example of the contents of .rhosts is:

pete.mybr.cc randy
grex.org gsibbery

Then, under your home directory on the remote system you want to connect to, create a ~/.ssh/known_hosts file, which contains the single line in your /etc/ssh_host_key.pub file on your local host.

Example of using RhostsRSA authentication to establish an SSH connection:

matt% ssh beer.randy.org (or ssh -l matt beer.randy.org)

Lemme know if this doesn't work.
ccieToBe

2003-01-24, 1:46 am

Thanks for the info Randy. I ended up writing a shell script to tunnel rsync over ssh instead. It was a 2 liner - fairly easy actually
Mr. Linux Guy

2003-01-24, 6:24 am

Great thinking! Glad you found a solution. Most of my scripts turn out to be one-four liners as well.
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net