Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi All,
I am new to linux. I am trying to write a script to automate ssh login using expect utility. After I login to the remote host, I should be able to execute a set of commands.Here's my script;
#!/usr/bin/expect
spawn username@hostname
expect "username@hostname's password:"
send "passwd"
interact
cd ~/customdirwhile executing script i have error as spawn, send command not found
What is it that i am doing wrong?
or is there any other way to automate remote loginAny help is highly appreciated
Regards,
Joseph

Do one command at a time to find problem.
"Best Practices", Event viewer, host file, perfmon, antivirus, anti-spyware, Live CD's, backups, are in my top 10

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |