Exit from telnet when run Remotely


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Exit from telnet when run Remotely
# 1  
Old 06-19-2007
Exit from telnet when run Remotely

ssh user@host -q -n 'grep `hostname` /etc/hosts; telnet 10.100.23.45 1234;'

When i run this command remotely it is hanging and not giving me the prompt, Can anyone tell me how can I exit a telnet command remotely please.

Thanks.
# 2  
Old 06-19-2007
Code:
ssh user@host -q -n 'grep `hostname` /etc/hosts; telnet 10.100.23.45 1234;'

Is 1234 the telnet port you are connecting to ?
# 3  
Old 06-19-2007
Encrypted,
Yes 1234 is the Port I am trying to telnet to.
# 4  
Old 06-19-2007
Please can anyone help me on this.
# 5  
Old 06-19-2007
Try using a -t option on ssh to allocate a pseudo terminal.
# 6  
Old 06-19-2007
ssh user@host -q -n -t 'grep `hostname` /etc/hosts; telnet 10.100.23.45 1234;'

I tried this but was of no help.
# 7  
Old 06-19-2007
You do realise the -n takes the input from /dev/null?

What happens if you log into the box and do

Code:
telnet 10.100.23.45 1234 </dev/null

also, what about..

Code:
ssh user@host -q -n telnet 10.100.23.45 1234

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Run yes/no script remotely

I have this script in server2 # cat /root/yesno.sh #!/bin/bash read -p "are you sure?" -n 1 -r if $ ]]; then echo "" echo "YES" else echo "NO" fi # sh /root/yesno.sh are you sure?y YES (5 Replies)
Discussion started by: anil510
5 Replies

2. Shell Programming and Scripting

Find not finding stuff if run remotely

Hello I'm working on script to find tomcat on all my servers. Then find out what version of tomcat is installed. Basically I want to check and see if the latest version is installed. I'm testing the script on Solaris 10. I'm also going to need it to work on RHEL and SLES. If I run the following... (7 Replies)
Discussion started by: bitlord
7 Replies

3. Shell Programming and Scripting

How to exit prompt when starting a weblogic administration server remotely?

Hi, I am trying to start Weblogic Admin server using start-up script (./startWeblogic.sh) from a remote host using a different user. The server starts fine but prompt is stuck, it does not return Background: We have multiple admin servers in different environment and the requirement is all... (4 Replies)
Discussion started by: bhaskar_m
4 Replies

4. UNIX for Dummies Questions & Answers

Auto-exit from telnet prompt

Hi, Hope all your are doing well. Need a suggestion from you. I am writing an automated shell script that will effectively check the telnet connectivity with different backends from present deployment server. Ideally, this script reads each backend hostname from a configuration file and fires... (4 Replies)
Discussion started by: bhaskar_m
4 Replies

5. Shell Programming and Scripting

howto run remotely call function from within script

Hi I have the following script : #!/bin/ksh #################### Function macAddressFinder ######################## macAddressFinder() { `ifconfig -a > ipInterfaces` `cat ipInterfaces` } ####################################################################### # # print... (2 Replies)
Discussion started by: presul
2 Replies

6. Shell Programming and Scripting

help needed. run shell scipt remotely

Dear all , I have a script. this script called get.sh and can get some solaris infomation and save the result as result.tar.gz. the problem is : we have 12 servers. every time. I need to login 12 server and do the same job 12 times.:mad: master server ... (2 Replies)
Discussion started by: chinesefish
2 Replies

7. Shell Programming and Scripting

KSH: Test telnet and exit

Hi, I need to do a test Telnet in KSH and if the connection is good then disconnect the telnet session with out logging in and without exiting the shell script. Example output of a good connection: $telnet xxx.xx.xx.xxx xxxx Trying xxx.xx.xx.xxx... Connected to xxx.xx.xx.xxx. Escape... (1 Reply)
Discussion started by: calex
1 Replies

8. Shell Programming and Scripting

how to avoid space to run remotely

If I run the following command remotely after ssh than it works fine su - oracle -c "/oracle/product/102/db/bin/dbshut" But If I run the following command it doesn't work su - oracle -c "/oracle/product/102/db/bin/lsnrctl stop" Because I think there is a space is present between lsnrctl and... (1 Reply)
Discussion started by: madhusmita
1 Replies

9. Shell Programming and Scripting

running commands with remotely with Telnet

i have a box here that can only be accessed with telnet. now, i was wondering if anyone know of a way of which i can run a command on that box remotely. (2 Replies)
Discussion started by: Terrible
2 Replies

10. UNIX for Dummies Questions & Answers

exit from telnet kills orbix process

Hi, I'm using a bourne shell to kick off a 3rd Pty app. This app uses Orbix. When I exit from the telnet session which started the app or hit CTRL-C at the command line, the orbix process dies, yet all other process remain. I've tried starting the app as a background process, but it still... (1 Reply)
Discussion started by: edgarm
1 Replies
Login or Register to Ask a Question