need help in telnet connection:


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting need help in telnet connection:
# 1  
Old 07-10-2008
need help in telnet connection:

i have 2 servers

test1
production2
------------------------------------

i have script called naveed2.sh in test1.Actually i m trying to connect from scritp naveed2.sh into server production2.

below the contents of script naveed2.sh

#!/bin/ksh

telnet production2.com< n2.txt
-------------------------------------------------------------------------

Actually the problem is how to pass username and password of production2 from script naveed2.sh ?????
# 2  
Old 07-11-2008
I recomment 'expect' or 'rsh' command.

I recommend 'expect' or 'rsh' command.

Last edited by hcliff; 07-11-2008 at 04:38 AM..
# 3  
Old 07-11-2008
Hello Ali,
You can try the following:
(echo <user id>; sleep 1; echo <password>)| telnet $SERVER
Although I didnt exactly understand the purpose of the <n2.txt part.
Thanks.

Last edited by Rajat; 07-11-2008 at 04:14 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Telnet in script Connection closed by foreign host

Hello, I'm trying to learn and automate some tasks via a script, but my first ever script failed with "connection closed by foreign host" error. I checked the other discussions but it didn't help. Could you please help? #!/bin/bash ( sleep 2 echo open x.x.x.x 23 sleep 2 echo user sleep 2... (1 Reply)
Discussion started by: Myrtle
1 Replies

2. Shell Programming and Scripting

Telnet connection closes before i execute GET command

I tried the below steps for telnet command from a remote server: 1. telnet myservice.com 443 2. GET / HTTP/1.0 3. Press enter key twice Please see the output below: bash-3.2$ hostname remoteserver1 bash-3.2$ telnet myservice.com 443 Trying 191.172.172.133... Connected to... (7 Replies)
Discussion started by: mohtashims
7 Replies

3. Linux

Telnet Connection refused error

Hi all, i got stuck with telnet issue, I am not able to telnet on 4001 port it show connection refused. with default port it will open # telnet 127.0.0.1 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. Fedora release 14 (Laughlin) Kernel 2.6.35.6-45.fc14.i686 on... (1 Reply)
Discussion started by: muzaffar.k
1 Replies

4. Shell Programming and Scripting

Success/failure status of telnet connection

Hi, I am running a shell script which will spawn the telnet and login. But sometimes, the telnet session itself is not getting spawned. My requirement is, if the telnet session is not spawned, the user must be notified that it failed. Is there any command to capture the status of telnet... (2 Replies)
Discussion started by: merin
2 Replies

5. Shell Programming and Scripting

How to close TELNET Connection

Hi, I have logged into a system using Telnet and iam unable to close the connection to connect to the next system using arrays. Iam getting error "Connection Timed Out" Iam using net::Telnet module. Please suggest.. (1 Reply)
Discussion started by: sudhakaryadav
1 Replies

6. Solaris

Telnet/ssh connection takes a lot of time.

We have three Oracle instances running on our Sun-Blade-T6300. Telnet or SSH connection to one of the instance (or to user oramach) takes a lot of time whether using putty or SecureCRT but connection to any other user is very fast. Any idea what may be causing this slow connection to this... (5 Replies)
Discussion started by: esmgr
5 Replies

7. SCO

Remote connection trought Telnet

Well... finally I took and old SCO Server and it works fine to keep working my ERP, but now I have a "LITTLE" trouble... with the other server we've made a connection trought TinyTerm with a DYNDNS Domain, in my firewall I noticed that there's a RULE establishing that the IP 192.168.0.1 (Server IP... (4 Replies)
Discussion started by: LIA_RAG
4 Replies

8. UNIX for Advanced & Expert Users

Telnet/FTP: Delayed Connection

Hi, I use a Solaris9 SPARC, NetraT4 machine which I connect to using telnet/FTP from Windows. But of late both the connections take quite a while to open a session. The problem occurs even when no one is connected to the system. The system works at normal speed once connected to. What might be... (1 Reply)
Discussion started by: mahatma
1 Replies

9. SCO

telnet connection refused

I installed Openserver 5.0.7 and I cannot telnet to the localhost and I can't telnet from my old SCO 3.2.42 to the new SCO machine but I can ping the new machine and it will telnet to the old machine. (2 Replies)
Discussion started by: printrick
2 Replies

10. UNIX for Dummies Questions & Answers

no telnet connection

I have a new SUN server from a sister company, and have been able to network it, and ping the server...however i can't telnet into the box. When it was at the sister companies site, we were able to telnet in then...just not not its on out network! Does anyone have a suggestion to what i need... (3 Replies)
Discussion started by: colesy
3 Replies
Login or Register to Ask a Question