Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jul 2002 23:17:28 +0200
From:      thrawn@linux.nu (Mattias Björk)
To:        freebsd-questions@freebsd.org
Subject:   Expect script problem with ssh login
Message-ID:  <3d39d3689a81a4.61372381@not right>

next in thread | raw e-mail | index | archive | help

Hi, I have a expect script that I have some problems with.

What I want to use this script is simply logon me on another machine and
enter the password when ssh prompts for it.And then give me a shell as I
Will manuly ssh to the host.

But I can't get this to work. Here is my script:

#!/usr/local/bin/expect
set server "somehost"
set username "someusername"
set password "somepassowrd"
spawn /usr/local/bin/ssh -l $username $server
expect "password:"
send "$password\r"

I get this error mesages when i try to run it:

spawn: not found
couldn't read file "password:": no such file or directory
send: not found

This does not work offcourse if I replace the varibles with real values.

I have checked the man page and searched google groups but I still can't get it to work, any help will be apritated.

Mvh Mattias Björk


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3d39d3689a81a4.61372381>