Saya coba bantu, silahkan ketik kode berikut, sebut saja namanya cekssh.sh

#!/bin/sh
# \
exec expect -f "$0" ${1+"$@"}
set password ISIPASSWORDSSH
spawn ssh [lindex $argv 0] [lindex $argv 1]
sleep 1
# SSH confirmation
#expect "(yes/no)?"
#send "yes\r"
expect "assword:"
send "$password\r"
expect eof

Jalankan scriptnya dengan sintaks sbb:

cekssh.sh [u...@host] [command]

Contoh:  cekssh.sh mylo...@myserver.com "ls -al"

regards,
DNF


--- Pada Kam, 26/2/09, net <netzerosp...@gmail.com> menulis:

> Dari: net <netzerosp...@gmail.com>
> Topik: Re: [linux-programming] login ke banyak mesin linux
> Kepada: linux-programming@linux.or.id
> Tanggal: Kamis, 26 Februari, 2009, 11:05 PM
> yeah about the security note its alright because it's
> just an experiment..
> 
> but still its possible right ??
> 
> oh iya kayanya bisa tuh pake expect... ada yang pernah
> nyoba gak ??
> 
> thanks
> 
> On 2/26/09, Yohanes Nugroho <yoha...@gmail.com>
> wrote:
> > 2009/2/25 net <netzerosp...@gmail.com>:
> >> mau login ke banyak mesin linux dengan menggunakan
> ssh
> >>
> >> tapi ga pake private public key
> >
> > coba pake program sshpass (di debian ada packagenya,
> mestinya untuk
> > linux lain juga ada).
> >
> > Tapi renungkan dulu ini:
> >
> > SECURITY NOTE: There is a reason openssh insists that
> passwords be typed
> > interactively. Passwords are harder to store securely
> and to pass around
> > securely between programs. If you have not looked into
> solving your needs
> > using SSH's "public key authentication",
> perhaps in conjunction with the ssh
> > agent (RTFM ssh-add), please do so before being
> tempted into using this
> > package.
> >
> > --
> > Regards
> > Yohanes
> > http://tinyhack.com/freewarelist/s603rd/
> >
> > --
> > Berhenti langganan:
> linux-programming-unsubscr...@linux.or.id
> > Arsip dan info: http://linux.or.id/milis
> >
> >
> 
> 
> -- 
> --from the net with zero space--
> 
> -- 
> Berhenti langganan:
> linux-programming-unsubscr...@linux.or.id
> Arsip dan info: http://linux.or.id/milis


      Nikmati chatting lebih sering di blog dan situs web. Gunakan Wizard 
Pembuat Pingbox Online. http://id.messenger.yahoo.com/pingbox/


--
Berhenti langganan: linux-programming-unsubscr...@linux.or.id
Arsip dan info: http://linux.or.id/milis

Kirim email ke