Just a matter of nesting the subshells.
It depends heavily on the exact shell you'd use at each level but something like this:
or
Alternativly, try substituting quotes in place of brackets if the shell doesn't like your syntax.
edit: Oh wait, your need to use telnet on the last hop...
For that, you'll need a .netrc file on host2 pipe into the telnet rather than provide the command as a parameter.
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT NETBSD
rlogin
RLOGIN(1) BSD General Commands Manual RLOGIN(1)NAME
rlogin -- remote login
SYNOPSIS
rlogin [-468Ed] [-e char] [-l username] [-p port] host
rlogin [-468Ed] [-e char] [-p port] username@host
DESCRIPTION
rlogin starts a terminal session on a remote host host.
rlogin first attempts to use the standard Berkeley rhosts authorization mechanism. The options are as follows:
-4 Use IPv4 addresses only.
-6 Use IPv6 addresses only.
-8 The -8 option allows an eight-bit input data path at all times; otherwise parity bits are stripped except when the remote
side's stop and start characters are other than '^S/^Q'.
-E The -E option stops any character from being recognized as an escape character. When used with the -8 option, this provides a
completely transparent connection.
-d The -d option turns on socket debugging (see setsockopt(2)) on the TCP sockets used for communication with the remote host.
-e char The -e option allows 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.
-l username the -l option specifies an alternate username for the remote login. If this option is not specified, your local username will
be used.
-p port Uses the given port instead of the one assigned to the service ``login''. May be given either as symbolic name or as number.
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, 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 used by rlogin:
TERM Determines the user's terminal type.
SEE ALSO rcmd(1), rsh(1), rcmd(3), hosts.equiv(5), rhosts(5), environ(7)HISTORY
The rlogin command appeared in 4.2BSD.
BUGS
More of the environment should be propagated.
BSD July 16, 2005 BSD