SCP script
Brad Crotchett
brad at ispn.net
Tue Dec 3 23:02:21 CST 2002
When I try adding -qBC and running it as a regular bash script, I get
the following error:
Permission denied (publickey,password,keyboard-interactive).
Thanks again,
Brad
-----Forwarded Message-----
> From: Eric R. <rossiter at discoverynet.com>
> To: Brad Crotchett <brad at ispn.net>
> Cc: kclug at kclug.org
> Subject: Re: SCP script
> Date: 03 Dec 2002 16:31:10 -0600
>
> Brad Crotchett wrote:
> > Hi all,
> >
> > I am trying to write a script that will run under cron and scp a file
> > from one server to another at night. I can run this command manually
> > just fine and it works:
> >
> > scp root at server1:/path_to_file /path_to_file_on_server2
> >
> > But when I put it in an expect script, it looks like it is launching
> > scp, but it never prompts for a password and just hangs there. Here is
> > the expect script:
> >
> > send " scp root at server1:/path_to_file /path_to_file_on_server2r"
> > expect "root at server1's password:"
> > send "passwordr"
> >
> > Am I missing something? Any help is appreciated.
> >
> > Brad
> >
> >
>
>
> Hi Brad,
>
> Try adding -qBC to your scp command. (scp -qBC ... ) will disable
> prompting for passwords.
>
> You're utilizing expect simply to feed scp the required password right?
>
> The above works nightly for me, scp's backed up files accross town
> running straight out of a bash script fired from cron. Doesn't prompt
> for password, and resolves the "no controlling tty" issue.
>
> HTH,
> E
>
>
>
>
More information about the Kclug
mailing list