auto-login script for connecting to remote m/n by using telnet/ftp/ssh
Hi all,
I need a script for getting connection to remote machine by using ssh/telnet/ftp. and that script should do 1.copy the files/scripts from my machine to remote machine. 2.execute the script at remote machine and copy the output file from remote m/n to my local machine. I have done with the connectivity part by using Expect script. #!/usr/bin/expect -f spawn telnet <IP address> expect -re "login" send "username\n" expect -re "Password" send "password of the user\n" interact Can you please help me for getting the other 2 requirements. Thanks in advance |
this is just weird, i've seen like 5 expect questions today, and hardly any ever before...
anywho... firslty don't use telnet. secondsly use ssh, thirdly use preshared keys to mean you don't need to log in at all. you've no need to run expect at all. ssh user@server mycommandiwanttorun > localoutputfile.txt |
RE: Auto Login with telnet
Quote:
The Auto login part works great I have been searching for days for a thing like that and this is the first one wich really worked Good Script 10x |
hi freinds
The above autologin script is not working on my system.
the error is spawn command not found send command not found am i Have to install these two programs prior to make this script runing?If yes,How? please revert |
Hi,
I made a free open source tool named SendCommand that would permit you to automate logins (ssh/telnet) and command execution on your routers. It has been developed in perl and it is highly customizable. Check it out: https://sourceforge.net/projects/sendcommand/ cheers |
COOL SCRIPT MAN! AWESOME!
I did this. apt-get install expect cd /usr/sbin vi autologin
So we create a file, where we can specify an IP address of the remote machine, your password and username. I am wondering how to make it dynamic for any ip like: autologin 10.10.1.1 |
All times are GMT -5. The time now is 11:45 AM. |