script to connect to different ip address thro telnet or ssh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script to connect to different ip address thro telnet or ssh
# 1  
Old 07-26-2005
script to connect to different ip address thro telnet or ssh

Hi,

I have three ip address say x.x.x.x , y.y.y.y and z.z.z.z

I am connecting to x.x.x.x first and from there i do telnet or ssh to y.y.y.y and getting into y and from there i do telnet or ssh to z.z.z.z

i want to know, can we write a script, which can automatically connect from x to y and from y to z..

is this possible??

pls help
# 2  
Old 07-26-2005
Please dont repost questions if they are not answered. You are breaking the rules.

https://www.unix.com/unix-for-dummies-questions-and-answers/20371-connecting-ip-address.html

Be patient. Someone will answer it.

Thanks,
vino
# 3  
Old 07-26-2005
sorry again

very sorry man...
# 4  
Old 07-26-2005
For commands like telnet and ssh you need to use a tool like expect to script the loggin on etc.

http://expect.nist.gov/
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script that tries to connect via SSH till connection is up

Hey, I need a script that tries to connect via SSH to a remote server and that remote server might not be up yet, so retry until succeed the error message I get if the server is not up yet is: ssh: connect to host 127.0.0.1 port 40001: Connection refused any idea of a good way to do it ? ... (5 Replies)
Discussion started by: OdedOvdat
5 Replies

2. Shell Programming and Scripting

Connect (SSH) to Windows server via Linux server through a script and passing command.. but failing

I am trying to connect to Windows server via Linux server through a script and run two commands " cd and ls " But its giving me error saying " could not start the program" followed by the command name i specify e g : "cd" i am trying in this manner " ssh username@servername "cd... (5 Replies)
Discussion started by: sunil seelam
5 Replies

3. Shell Programming and Scripting

Shell script to connect to multiple ssh servers

Hello, I have access to several linux servers (mostly centos based) located in a DC in another country. from day to day I need to login to each of them to do some work (they dont have gui/window manager installed, I work only from console), or even to just do a check like df -h for disc usage.... (3 Replies)
Discussion started by: MaRiOsGR
3 Replies

4. Shell Programming and Scripting

shell script for how to connect to a remote server by using ssh

i want to connect to a remote server through ssh. i have to also provide password within that script. after connecting to the remote server i want to do some operations like grep,cd etc can u pls help me to wite a script. Thanks (1 Reply)
Discussion started by: millan
1 Replies

5. UNIX for Dummies Questions & Answers

Telnet and ssh in a script

dear all, I know that this question has been asked before frequently, but I really don't get it. My question is composed of several ones. First:To telnet through a script, I was told to use the way described below, and it works for me, but i don't understand the syntax here.... (3 Replies)
Discussion started by: marwan
3 Replies

6. UNIX for Dummies Questions & Answers

telnet, ftp is running but can't connect from outside

Yesterday, I and all my users couldn't connect to my server using ssh, telnet or ftp even though they were running (keep getting "connection timed out" error message). This morning, my partner logon from the main console, restarted sshd and xinetd (I belive he didnt restarted the server), now I... (0 Replies)
Discussion started by: Micz
0 Replies

7. UNIX for Dummies Questions & Answers

Blocking ftp users to connect using telnet

Hi everybody ! We have all flavors of Unix / Linux and we want to restrict ftp users to telnet our servers. We can't disable telnet because we have other users using it. :confused: Are there any thing that could be done to solve this thing ??? Best regards, Julio Moreira (11 Replies)
Discussion started by: juliocdrm
11 Replies

8. Solaris

connect whit Telnet without password

It's possible to connect whit Telnet (or rlogin) whithout password??? I must write a script (this script run on a windows machine), then after the connection on Unix machine, run a perl script and exit. I can know if an host can be consedered "Trusted" like SSH protocol? Thanks! (2 Replies)
Discussion started by: raffyTxT
2 Replies

9. Shell Programming and Scripting

Error while trying to fire a PL/SQL thro Unix Script

hi , I tried running a PL/SQL script through unix shell script. But am getting the following error. "Message file sp1<lang>.msb not found Error 6 initializing SQL*Plus " Kindly suggest. Regards, Samit (5 Replies)
Discussion started by: dharmesht
5 Replies

10. UNIX for Dummies Questions & Answers

How to Re-connect to floating telnet sessions

We use SCO OSR5 with TermLIte to create telnet sessions. If you accidently click X on the TermLite screen and exit the session you leave process running. I've heard of a program that will allow you to re-connect to these 'floating' sessions and then be able to carry on your session. Does anyone... (2 Replies)
Discussion started by: mikeh
2 Replies
Login or Register to Ask a Question