running scp or rsync from a script

Bob Smith bob at netprt.com
Wed Jul 28 16:06:32 UTC 2004


*man ssh_config* will explain how to set up a specific account 
configuration which will allow you to configure batch mode for the 
user.  This disables password authentication.

If you don't want to do that, then you might look at Expect, which is 
another scripting language.  It allows you to program the password into 
the script file in a pseudo-interactive manner.  http://expect.nist.gov/

-Bob


Chris Purcell wrote:

>I have a bunch of Linux workstations that need to copy files to a central
>server via cron daily.   I want to set up either an scp or rsync script
>(either Perl or bash), but the problem is the password prompt.  There
>doesnt' seem to be anyway to enter a password into an scp script, but with
>rsync I can use the --password-file=FILE option only if the central server
>is running the rsyncd daemon.   I'd much rather use scp than have to run
>an rsync server.   I guess my only option with scp would be to set up
>RSA/DSA keys.   The workstations will scp to the server as a user called
>"tc", not root.   It would be way too much work having to copy
>certificates from each workstation to the server so I was wondering if its
>possible to allow anybody to ssh/scp into the central server as the user
>"tc" without entering a password?    The user "tc" has very limited access
>and the server is on a LAN, so security isn't an issue here.  Does anyone
>have any other ideas on how to go about doing this?
>
>Thanks,
>Chris
>
>
>
>  
>



More information about the redhat-list mailing list