Sponsored Content
Top Forums Shell Programming and Scripting script for nested rlogin and telnet Post 302173331 by mcburke38 on Thursday 6th of March 2008 11:03:32 AM
Old 03-06-2008
I've made some progress. So far I can remsh into host1, then from host1 I can remsh into host2, and then from host2 I can telnet into host3 with this script:

#! /bin/csh

remsh host1 "remsh host2 "telnet host3""

The final hurdle I need to get over is executing a command on host3. I've tried:

remsh host1 "remsh host2 "echo 'command' | telnet host3""

But that didn't even seem to telnet me into host3, I got an error saying "no route to host". If I manually rlogin into host1 and then from there manually log into host2 and execute the command "echo 'command' | telnet host3" it works just as I'd like. I don't get why it can't do it via a script.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

rlogin & telnet

hi what is the main difference between rlogin and telnet? Or they are synonymous cheers (13 Replies)
Discussion started by: g-e-n-o
13 Replies

2. UNIX for Dummies Questions & Answers

telnet, rlogin, ssh login probblem

Hello Friends, I had an IRIX box won't let me login with any IDs (even root) Telnet, Rlogin, SSh. However, I can login by single user with root ID. Telnet login >>> Connection closed by forgeign host. Rlogin >>> Connection closed SSh login >>> connection to address ???.????.???.??? ... (1 Reply)
Discussion started by: anphdula
1 Replies

3. Shell Programming and Scripting

rlogin from Shell script

I am logged into an AIX Unix box. From there I want to remotely login to remotely login to an HP-UX Unix box and want to execute a command that will create a file. I want to get the file to the AIX box. Can someon eplease advise how to automate that in a shell script? At the first step I want to... (2 Replies)
Discussion started by: asutoshch
2 Replies

4. Shell Programming and Scripting

rlogin inside a c-shell script

Hi Forumers, Sorry if it's really simple, but I couldn't find a way out. :( I've to do something like this in a script (csh): <some commands, variable settings, scripts> rlogin different_server <some commands, variable settings, scripts> After "rlogin", it shows the prompt of the... (5 Replies)
Discussion started by: sumitgarg
5 Replies

5. Solaris

rlogin, telnet connections timeout

Hi, I have a Sun Ultra 5 desktop with Solaris 8. When I telnet/rlogin into any other host, the connection closes after few hours of inactivity. I also have another Windows box which I use rarely. But when I telnet/rlogin into the same hosts using putty, the connection stays for days without any... (5 Replies)
Discussion started by: dr_gsb
5 Replies

6. IP Networking

rlogin,telnet-different or same?

Hai guys, Both "rlogin" and "telnet" are used to login remote host.Is there any differece between these 2 commands? (or) are both same? Thanks (1 Reply)
Discussion started by: Felicia23
1 Replies

7. Shell Programming and Scripting

Nested Case in UNIX script

Hi I wanted to know if we can write a nested case in UNIX script. Something like following - Case ${sDB} in Srvr1) case ${sSchema} Sch1) DBusr=Username1 DBPwd=Pwd1 ;; Sch2) DBusr=Username2 ... (1 Reply)
Discussion started by: sumeet
1 Replies

8. Shell Programming and Scripting

rlogin and telnet

I want to make a script which will execute a command from a remote server like below rlogin server1 then telnet server2 (username, password will be given) now execute command (it may "ls -l *.txt") and give the output I've to do this manually but want to make it automatic Script may... (4 Replies)
Discussion started by: shoeb
4 Replies

9. Shell Programming and Scripting

rlogin and script

I am writing a script to do rlogin to another system and execute commands on the remote system, i can successfully login to the remote system but the commands are not sent. i can only use rlogin to get to the remote system. what can i do? (6 Replies)
Discussion started by: aydj
6 Replies

10. Shell Programming and Scripting

Script to eliminate files .rlogin

Hi guys, I'm try making to script for eliminate files rlogins. path1='/home/*' for i in `cat /etc/passwd |awk -F: '{print $6}'`; do if test "$i" = "$path1"; then echo $i cd $i if ; then echo "$i/.rhosts detectado"|mail -s "rhosts" root ... (14 Replies)
Discussion started by: nena_redbalon
14 Replies
RLOGIN(1)						    BSD General Commands Manual 						 RLOGIN(1)

NAME
rlogin -- remote login SYNOPSIS
rlogin [-468DEd] [-e char] [-i localname] [-l username] host DESCRIPTION
The rlogin utility starts a terminal session on a remote host host. The standard Berkeley rhosts authorization mechanism is used. The following options are available: -4 Use IPv4 addresses only. -6 Use IPv6 addresses only. -8 Allow an eight-bit input data path at all times; otherwise parity bits are stripped except when the remote side's stop and start char- acters are other than ^S/^Q. -D Set the TCP_NODELAY socket option which can improve interactive response at the expense of increased network load. -E Stop any character from being recognized as an escape character. When used with the -8 option, this provides a completely transparent connection. -d Turn on socket debugging (see setsockopt(2)) on the TCP sockets used for communication with the remote host. -e Allow user specification of the escape character, which is ``~'' by default. This specification may be as a literal character, or as an octal value in the form nn. -i Allow the caller to specify a different local name to be used for authentication. This option is restricted to processes with uid 0. -l Specify a different username for the remote login. If this option is not specified, your local username will be used. A line of the form ``<escape char>.'' disconnects from the remote host. Similarly, the line ``<escape char>^Z'' will suspend the rlogin ses- sion, and ``<escape char><delayed-suspend char>'' suspends the send portion of the rlogin session, but allows output from the remote system. By default, the tilde (``~'') character is the escape character, and normally control-Y (``^Y'') is the delayed-suspend character. All echoing takes place at the remote site, so that (except for delays) the rlogin is transparent. Flow control via ^S/^Q and flushing of input and output on interrupts are handled properly. ENVIRONMENT
The following environment variable is utilized by rlogin: TERM Determines the user's terminal type. FILES
/etc/hosts /etc/hosts.equiv $HOME/.rhosts SEE ALSO
login(1), rsh(1), telnet(1), setsockopt(2), ruserok(3), tty(4), hosts(5), hosts.equiv(5), rlogind(8), rshd(8) HISTORY
The rlogin command appeared in 4.2BSD. IPv6 support was added by WIDE/KAME project. BUGS
The rlogin utility will be replaced by telnet(1) in the near future. More of the environment should be propagated. BSD
September 26, 2003 BSD
All times are GMT -4. The time now is 01:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy