09-01-2003
Re: Call Telnet From Within A Shell?
try rlogin (which need to edit file /etc/hosts.equiv) so,
use man rlogin or rcmd
Quote:
Originally posted by Tubbietoeter
Hi there,
I got a big problem.
For one of our customers I did a website (php) that connects to another machine "A" (server) to machine "B" via expect.
Now he wants that after the the connection with "B" is established, a telnet connection to "C" is opened, and some commands are executed. The results need to be retrieved too.
The problem is, it's not so easy to start telnet from a shell, since you only can give the username with it when its started but not the password. We don't have any permissions to install anything on "B" nor "C"; we could put a script on "B" though to connect with "C".
Does anyone have a shell skript that connects to another machine via telnet? Or a php skript which connects from "A" to "B" to "C"?
Any ideas on this? I'm going nuts about this ...
Thanks for your help!
Steff
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, im brasilian, sorry for bad english ok? Well, im writing one honeypot, look:
#!/bin/bash
echo ""
echo `cat /etc/welcome.pot`
echo ""
echo -n "login: "; read usuario
echo -n "Password: "
#stty -echo
read -s senha
#stty echo
exit
Running it in localhost, thats right:
... (1 Reply)
Discussion started by: juniordevil
1 Replies
2. Solaris
I would like to log into a server read a certain file and get the results back. I have tried like below to no avail;
#!/bin/ksh -x
(
sleep 2
echo sdpuser
sleep 2
echo cs3reloaded
sleep 5
cd /export/home/scripts/daily_checks
sleep 5
head daily_check_report.txt > test160108.txt
exit
)... (6 Replies)
Discussion started by: ricky katix
6 Replies
3. Shell Programming and Scripting
Hi guys, please help me
I have a ksh script (second picture down), in that script I define the function DATECALC.
Now I want to use this function KSH in a program shell.
How can I call this ksh from my shell program?
My shell program is... in the first two lines I tried to call... (1 Reply)
Discussion started by: acevallo
1 Replies
4. Shell Programming and Scripting
hi guruz,
i have problem
i have 2 servers running IBM AIX-UNIX
i have already made a shell which will take input from user & execute accordingly .... this input is then ftp to another system as .txt (which i have done too)
Now in the same shell i wanna invoke a shell on system B to be... (2 Replies)
Discussion started by: The_Archer
2 Replies
5. Shell Programming and Scripting
Hi
I need to telnet a device with IP Address and port. After logging in, I need to execute some commands in that device. Please find the example below
telnet 170.10.11.1 2100 #170.10.11.1 is the IP address. 2100 is the Port
after telnet, the device will show the command prompt as : ... (2 Replies)
Discussion started by: sudharsan23
2 Replies
6. Red Hat
please help me in this script
shell script :1
***********
>cat file1.sh
#!/bin/bash
echo "this is first file"
function var()
{
a=10
b=11
}
function var_1()
{
c=12
d=13 (2 Replies)
Discussion started by: ponmuthu
2 Replies
7. Shell Programming and Scripting
Can someone help me figure out how to call a c program from this shell script? I want to echo a #9 option and have it call and execute a c file called dmcc.c.
#!/bin/sh
# dmc.sh
#clear
# display menu
while :
do
echo "1. Display date and time."
echo "2. Display what users are doing."... (7 Replies)
Discussion started by: jiro
7 Replies
8. Shell Programming and Scripting
#!/bin/bash
FUN_ECHO(){
echo $1
}
FUN_ECHO "hi how are you ?"
This code will work fine.
BUT is it possible to make the following to work ?
FUN_ECHO "hi how are you ?"
FUN_ECHO(){
echo $1
}
I know that the code will be executed line by line. But i have a number of... (5 Replies)
Discussion started by: linuxadmin
5 Replies
9. Shell Programming and Scripting
i have written a script as shown below :
telnet 10.161.240.2 8100
<?xml version="1.0"?> <login_command> <sequence id="1" /> <access id="1"/> <user name = "user1" password = "pass"/> </login_command>
<?xml version="1.0"?> <RegistrationDescriptor> <sequence id="1" /> <access id="1"/>... (4 Replies)
Discussion started by: akrati1
4 Replies
10. Shell Programming and Scripting
Hello Guys,
I have a linux server where I already logged in, once logged in, i telnet to local host using some dedicated port and do some action. This I can easily do manually.
Since I need to fire a lot requests so I would like to optimize it using a shell script to avoid telnetting each... (3 Replies)
Discussion started by: umarsatti
3 Replies
LEARN ABOUT FREEBSD
rlogin
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