2009/3/5 net <netzerosp...@gmail.com>: > wups bisa om pake expect tapi kok script yang di atas ga jalan yah > > sementara saya masih pake yang bawah ini (walaupun sebenernya saya > maunya pk script yang diatas soalnya bisa saya gabung dengan while > untuk membaca list server dari text file) > > dan masih bermasalah ketika belum tercantum di known host.. (expect > biga gak pake if ?? ) > > ada ide.. ??
Tetep kepengen expect ya? #!/usr/bin/expect spawn ssh ocr...@10.146.59.26 expect { "(yes/no)?" { send "yes\r" exp_continue } "Password:" { send "p...@ssw0rd\r" } } send "ls -l\r" expect eof > > #!/usr/bin/expect > spawn ssh ocr...@10.146.59.26 > # SSH confirmation > #expect "(yes/no)?" > #send "yes\r" > expect Password: > send "p...@ssw0rd\r" > send "ls -l\r" > expect eof > > > On 3/2/09, Dani Firman Syah <xnu...@yahoo.com> wrote: >> >> 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 >> >> > > > -- > --from the net with zero space-- > > -- > Berhenti langganan: linux-programming-unsubscr...@linux.or.id > Arsip dan info: http://linux.or.id/milis > > -- Regards Yohanes http://tinyhack.com/freewarelist/s603rd/ -- Berhenti langganan: linux-programming-unsubscr...@linux.or.id Arsip dan info: http://linux.or.id/milis