Sponsored Content
Full Discussion: telnet in a script
Top Forums UNIX for Dummies Questions & Answers telnet in a script Post 8351 by sskb on Wednesday 10th of October 2001 11:37:00 AM
Old 10-10-2001
PHP

i tried the following.. and got my system stuck. that is after executing this everything went fine and i got a prompt.. but i could not execute anything from that.

what is going wrong?

Code:
 #!/bin/csh
( echo open hostname
  sleep 5
  echo username
  sleep 1
  echo password
  sleep 1
  echo dtterm ) | telnet

Smilie

added code tags for readability --oombera

Last edited by oombera; 02-19-2004 at 05:37 PM..
sskb
 

10 More Discussions You Might Find Interesting

1. IP Networking

telnet in a script

Does anyone have a script that contains the telnet command and passes the login and password in the script as well? (4 Replies)
Discussion started by: vaccari
4 Replies

2. UNIX for Dummies Questions & Answers

telnet through script

Hi, How to write a script to perform telnet/ftp operation. Also please refer some site to get reference about shell scripting. Thanks in advance -Arun. (1 Reply)
Discussion started by: arun.viswanath
1 Replies

3. Shell Programming and Scripting

how to use telnet in script

I am trying to use telnet in shell script but getting following error error Connected to crmapp00.agf.ca. Escape character is '^]'. Connection closed by foreign host. Script #!/bin/ksh PATH=/usr/sbin/:/usr/bin:/usr/ucb:/etc:/usr/local/bin:. telnet HOSTNAME <<SCRIPT user userid... (9 Replies)
Discussion started by: sibghat
9 Replies

4. Shell Programming and Scripting

Telnet Script

Hi, I have the following code ... (sleep 1; echo $USERID ; sleep 1; echo $PASSWD ; sleep 1 ; echo y ; sleep 1 ; echo "\r" ; sleep 1 ; echo "cd $FILEPATH" ; sleep 1 ; echo "pwd"; sleep 1 ; echo df -k .| tail -1| cut -d ' ' -f8 > aop.txt ; echo "pwd" ; cat aop.txt; sleep 3)| telnet $SERVER the... (1 Reply)
Discussion started by: King Nothing
1 Replies

5. Shell Programming and Scripting

Using Telnet in a script

Hi All, I was trying to use telnet in a script to access a certain processor on a certain port to view some processes. The problem is that when I use telnet the output is displayed for me. The script is: #!/bin/sh cd /ahmed/ezzat/ rm ss7trace.log touch ss7trace.log chmod 755... (3 Replies)
Discussion started by: Ahmad Ezzat
3 Replies

6. Shell Programming and Scripting

telnet script help

Hi Guys, How do I write the script for the following telnet 192.168.1.100 9002 if the result is less than 1 second. The script should say as port open if the result takes more than 3 seconds. The script should display as port closed. Thanks, Charan (1 Reply)
Discussion started by: charan314
1 Replies

7. Shell Programming and Scripting

Telnet script

Hi all, I would like to write a ad hoc shell script that would allow me to do some telnet tests to multiple IP's and ports at the same time . So, I want to determine which one is successful and which one fails. So, basically I would like the shell to spawn the telnet test and to break out of... (3 Replies)
Discussion started by: Pouchie1
3 Replies

8. Shell Programming and Scripting

telnet script

Hi, I need a script that take one parameter as destination hostname and two parameter as ranges and tries telnet and records the successful connections. fo reg: ./testtelnet.sh destination-host 1000 1050 should give me all the port between 1000 and 1050 what successfully connected to... (10 Replies)
Discussion started by: shifahim
10 Replies

9. Shell Programming and Scripting

Telnet Script

Hello, I wrote a script for doing telnet.However the requirement got changed and now I have to write a telnet script that will 1. Do the telnet from all the virtual ips in a box(Ex: x.x.x.x is the box ip, and x.x.x.1,x.x.x.2 etc are virtual ips associated with that box.) 2. The port range... (0 Replies)
Discussion started by: coolkid
0 Replies

10. Shell Programming and Scripting

Telnet Script

Hello, I wrote a script for doing telnet.However the requirement got changed and now I have to write a telnet script that will 1. Do the telnet from all the virtual ips in a box(Ex: x.x.x.x is the box ip, and x.x.x.1,x.x.x.2 etc are virtual ips associated with that box.) 2. The port range... (3 Replies)
Discussion started by: coolkid
3 Replies
rlogin(1)						      General Commands Manual							 rlogin(1)

NAME
rlogin - Connects the local host with a remote host SYNOPSIS
rlogin [-8L] [-e character] [-l user] remote_host The remote login command (rlogin) logs into remote_host and connects your local terminal to the remote host. OPTIONS
Allows an 8-bit data path at all times. Otherwise, unless the Stop and Continue key sequences on the remote host are not standard, rlogin uses a 7-bit data path and the eighth (high) bit of each byte is stripped. Changes the Escape character. Substitute the character you choose for character. Changes the remote username to the one you specify. Otherwise, your local username is used at the remote host. Allows the rlogin session to be run in litout mode. In this mode, the escape sequence ~. (where ~ is the escape character) disconnects you from the remote host and the escape sequence ~^Z (where ^Z, or Ctrl-Z, is the suspend character) suspends the rlogin session if you are using csh. DESCRIPTION
The remote terminal type is the same as that given in the local TERM environment variable. The terminal or window size is also the same, if the remote host supports them, and any changes in size are transferred. All echoing takes place at the remote host, so except for delays, the terminal connection is transparent. Pressing the Stop and Continue key sequences stops and starts the flow of information, and the input and output buffers are flushed on Interrupts. The rlogin command can only be used to connect to systems that are running the rlogind daemon. On systems that do not support rlogin, you can use telnet (if supported) as an alternative. If you do not specify the -l option, the local username is used at the remote host. If -l user is specified, the username entered is used at the remote host. In either case, the remote host allows access only if one or both of the following conditions is satisfied: The local host is included in the remote host's /etc/hosts.equiv file, the local user is not the superuser, and the -l user option is not specified. The local host is included in a $HOME/.rhosts file in the home directory of the remote user account. If -l user is specified, the local username must also be included in the file. If neither of these conditions is met and a password is defined for the remote user account, the remote host prompts for a password. The remote password file is checked to verify the password entered, and the login prompt is displayed if the password is not correct. Pressing the End-of-File key sequence at the login prompt ends the remote login attempt. For security reasons, any $HOME/.rhosts file must be owned by either the remote user or the root user and should have permissions set to 600 (read and write by owner only). In addition to the preceding conditions, rlogin also allows access to the remote host if the remote user account does not have a password defined. However, for security reasons, use of a password on all user accounts is recommended. Unless otherwise modified by the -e option, the standard Escape character for disconnecting from the remote host is a ~ (tilde). The Escape character is only recognized by the remote host if it occurs at the beginning of a line. Otherwise, the Escape character is sent to the remote host as a normal character. To send the Escape character to the remote host as a normal character at the beginning of a line, press the Escape character twice. Pressing the Escape character and a (dot) (for example, ~.) immediately disconnects the local terminal from the remote host. EXAMPLES
In the following examples, the local host is listed in the /etc/hosts.equiv file at the remote host: To log in to a remote host with your local username, enter: $ rlogin host2 Password: <Enter password> To log off the remote host and close the connection, enter the End-of-File key sequence. To log in to a remote host with a differ- ent username, enter: $ rlogin host2 -l dale You are prompted to enter your password and then are logged in to the remote host host2 with the username dale. To log in to host2 with the your local username and change the Escape character to (backslash), enter: $ rlogin host2 -e\ FILES
Specifies remote hosts from which users can execute commands on the local host (provided these users have an account on the local host). Specifies remote users who can use a local user account. SEE ALSO
Commands: rcp(1), rsh(1), rlogind(8), telnet(1) Files: rhosts(4) rlogin(1)
All times are GMT -4. The time now is 01:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy