From owner-freebsd-security Wed Jun 12 7:33:57 2002 Delivered-To: freebsd-security@freebsd.org Received: from cithaeron.argolis.org (bgm-24-169-166-7.stny.rr.com [24.169.166.7]) by hub.freebsd.org (Postfix) with ESMTP id A71E937B407 for ; Wed, 12 Jun 2002 07:33:51 -0700 (PDT) Received: from cithaeron.argolis.org (localhost [127.0.0.1]) by cithaeron.argolis.org (8.12.3/8.12.3) with ESMTP id g5CEXjva036793; Wed, 12 Jun 2002 10:33:45 -0400 (EDT) (envelope-from piechota@argolis.org) Received: from localhost (piechota@localhost) by cithaeron.argolis.org (8.12.3/8.12.3/Submit) with ESMTP id g5CEXeZi036790; Wed, 12 Jun 2002 10:33:40 -0400 (EDT) X-Authentication-Warning: cithaeron.argolis.org: piechota owned process doing -bs Date: Wed, 12 Jun 2002 10:33:40 -0400 (EDT) From: Matt Piechota To: Anthony Schneider Cc: Peter Pentchev , twig les , Jack Xiao , , Lowell Gilbert , "Mark S." , Derek Ragona Subject: Re: ssh questions In-Reply-To: <20020612141456.A18932@mail.slc.edu> Message-ID: <20020612102816.E36620-100000@cithaeron.argolis.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, 12 Jun 2002, Anthony Schneider wrote: > I've never had a problem sending passphrases to ssh via expect, personally. This is a rather poorly written expect script that I use to tar up a cvs tree on a computer in a rather restrictive lab. It's biggest problem is the password is in the file, and shows up in the cron mail. It should be a decent start, and I should really get to reading that expect book I have. :) Check this: #!/usr/freeware/bin/expect -f set timeout 120 spawn /usr/local/bin/ssh piechota@fsmvpn2 expect "password" send "xxxx\r" expect "(~)%" send "rm -f bdf.tar\r" expect "(~)%" send "cd /home/cvs\r" expect "(/home/cvs)%" send "tar cvf /home/piechota/bdf.tar bdf\r" expect "(/home/cvs)%" send "exit\r" set timeout 900 spawn /usr/local/bin/scp piechota@fsmvpn2:/home/piechota/bdf.tar fsmcvs.tar expect "password" send "xxxx\r" expect "100%" send "expect done\r" -- Matt Piechota To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message