yup sshpass nya error compile

harus memanfaatkan resource yang ada om :p

hum kondisi dengan {

bisa di coba nih

tapi mau nanya tentang
exec expect -f "$0" ${1+"$@"} <-- untuk $0 itu kan argumen 0 yah
maksud nya kalo lanjutan nya apa.. ?

spawn ssh [lindex $argv 0] [lindex $argv 1]

kalo jalanin nya kaya gini cekssh.sh [email protected] "ls -al"

mylogin itu bukan nya argumen 1

tapi kalo saya rubah jadi
exec expect -f "$1" ${2+"$@"}  <-- malah gabisa
spawn ssh [lindex $argv 1] [lindex $argv 2]

hehe

On 3/5/09, Yohanes Nugroho <[email protected]> wrote:
> 2009/3/5 net <[email protected]>:
>> 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 [email protected]
> expect {
>  "(yes/no)?" {
>         send "yes\r"
>         exp_continue
>  } "Password:" {
>        send "p...@ssw0rd\r"
>   }
> }
> send "ls -l\r"
> expect eof
>
>
>
>
>>
>> #!/usr/bin/expect
>> spawn ssh [email protected]
>> # 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 <[email protected]> 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 [email protected] "ls -al"
>>>
>>> regards,
>>> DNF
>>>
>>>
>>> --- Pada Kam, 26/2/09, net <[email protected]> menulis:
>>>
>>>> Dari: net <[email protected]>
>>>> Topik: Re: [linux-programming] login ke banyak mesin linux
>>>> Kepada: [email protected]
>>>> 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 <[email protected]>
>>>> wrote:
>>>> > 2009/2/25 net <[email protected]>:
>>>> >> 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:
>>>> [email protected]
>>>> > Arsip dan info: http://linux.or.id/milis
>>>> >
>>>> >
>>>>
>>>>
>>>> --
>>>> --from the net with zero space--
>>>>
>>>> --
>>>> Berhenti langganan:
>>>> [email protected]
>>>> 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: [email protected]
>>> Arsip dan info: http://linux.or.id/milis
>>>
>>>
>>
>>
>> --
>> --from the net with zero space--
>>
>> --
>> Berhenti langganan: [email protected]
>> Arsip dan info: http://linux.or.id/milis
>>
>>
>
>
>
> --
> Regards
> Yohanes
> http://tinyhack.com/freewarelist/s603rd/
>
> --
> Berhenti langganan: [email protected]
> Arsip dan info: http://linux.or.id/milis
>
>


-- 
--from the net with zero space--

--
Berhenti langganan: [email protected]
Arsip dan info: http://linux.or.id/milis

Kirim email ke