i am trying to use telnet inside of a ksh script.
i would like to do like the following:
and with this piece of code, i would like to telnet another machine, and let the user use telnet to work on the other machine.
It's like if the command was typed directly into the command prompt: the user then enters the password and continues working on the other machie until he types "exit" then he returns back to the first machine.
But it doesn't seem to work, i get "connection closed by foreign host" at the end of my script.
I hope you understand my problem. Can you please help ?
And idially, i would also like the script to enter the password automatically, if possible, but it's optionnal.
Might be easier with the "rlogin" command?
Providing that the account name exists on both computers, "rlogin" can be configured to log in without a password.
you're right it's easier.
but actually i had a problem using rlogin, it takes a long time before returning an error:
but you know what, it's because i was using rlogin on the same machine, i guess that was the problem.
Thank you very much, i'm gonna switch back to "rlogin"
---------- Post updated at 02:19 PM ---------- Previous update was at 02:03 PM ----------
actually the was never the problem (rlogin to own machine)
do you know what could cause the "Connection refused" problem when using rlogin instade of telnet ?
Try:
But to use telnet or rlogin, the remote system must be configured to allow it. rlogin is a very insecure program and most decent sys admins will prohibit it. (telnet isn't great for security either but it is better than rlogin.) If you get "connection refused" it is disabled, probably by intent.
Hi Team,
Not getting the file output inside my email which i am sending from unix box. . Please refer the below code :
#!/bin/sh
{
sleep 5
echo ehlo 10.56.185.13
sleep 3
echo mail from: oraairtel@CNDBMUREAPZP02.localdomain
sleep 3
echo rcpt to: saurabhtripathi@anniksystems.com... (1 Reply)
I'm trying to do an ls from inside of a ksh script. I loop through the results one line at a time and attempt to do a substitution using sed to convert YYYYMMDD from the older files into the newer files. Basically sometimes the ETL load runs over midnight and half the files are off by one day... (3 Replies)
I am writing perl script to configure Cisco device but Variables inside Net::Telnet::Cisco Module doesn't work and passed to device without resolving.
Please advise.
here is a sample of script:
use Net::Telnet::Cisco;
$device = "10.14.199.1";
($o1, $o2, $o3, $o4) = split(/\./,$device);... (5 Replies)
Hi there,
I am new to Perl and KSH. The system I am using picks up the KSH scripts and uses them in a batch job control system.
I am trying to set a variable from a perl command
#!/bin/ksh -eaxp
#*******************************************************************************
# Testing... (5 Replies)
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)
Hi All,
I have multiple functions in my script and I'm trying to capture stdout from some of them, but I also do some error checking in them (in the functions that output something to their stdout that needs capturing) and I need to be able to end the entire script with an error message.
... (2 Replies)
please i need to make telnet in an script but i cant use delay into the instruction because i dont know how many time takes an instruction to compleate in the other computer.How can i do? is there any form to do that??
please help
sorry for my english.... (2 Replies)
please i need to make telnet in an script but i cant use delay into the instruction because i dont know how many time takes an instruction to compleate in the other computer.How can i do? is there any form to do that??
please help
sorry for my english.... (1 Reply)
I am trying to write a ksh script of using telnet.
On server1, I have a script that wants to telnet to server2 and run it on server2. Then after finish, brings back information to server1. Is it possible? How can I write it on ksh?
Any feekback is appreciated. (5 Replies)