Wednesday, 14 August 2013

Terminal (#!/usr/bin/expect) can the "expect" script be turned into regular commands so no script necessary?

Terminal (#!/usr/bin/expect) can the "expect" script be turned into
regular commands so no script necessary?

I found a passwordless entry code. but it must be turned into a script and
then made executable and so on..
for it to work.
it works beautifully none-the-less.
#!/usr/bin/expect
set login "root"
set addr "119.********"
set pw "KkU5D4G9afcW"
spawn ssh $login@$addr
expect "$login@$addr\'s password:"
send "$pw\r"
interact
this code is awesome, for the first time in my life i am able to login to
a server via ssh without having to paste password.
but it seems rather impractical that a script must be executed for it to
work.
can it work without a script ?

No comments:

Post a Comment