something missing in my expect script
Hi,
I am trying hard on getting this done. This is the first time i am using a expect script. Here is a simplified way of what i am trying to use via expect. Code:
ssh localhost Code:
[root@centos 4.0.10]# ./test2 it is just waiting for the user to input and hence the expect is not doing what it's supposed to. Any idea, What am i missing here. Thanks in advance. Any help appreciated. |
^ if your using expect to use passwordless login via ssh then you are going about it the wrong way. look up ssh with keys. your definately going about it the wrong way if you are trying to login remotely into the root account.
|
Your script is looking for "assword" not "root@localhost's password:"
try Quote:
this will help: http://bash.cyberciti.biz/security/e...-login-script/ And agreed with schneidz. If passwordless login is all you are looking for definitely look into ssh with keys |
Thanks folks.
Well, i am not actually using ssh in my script. as i mentioned before, i just put that to simplify it. Actually, i have a tool which runs and prompts for users to input values (similar to how ssh waits for user input). Quote:
Thanks |
How are you running the script?
The following script work for me, could you give that a try and let us know the results? (replacing some_host and some_password with a real host and password for a ssh user) Filename: testscript Quote:
Quote:
|
Thanks a lot.
It's working. I was missing the "interact". Thanks again. |
All times are GMT -5. The time now is 07:12 AM. |