scripting Telnet


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers scripting Telnet
# 1  
Old 06-30-2003
scripting Telnet

can someone tell me how i can write a shell script that will automatically log me in to any machines i want without bothering me for some password input? (i know i have to put in a password but I would like to take care of that in the script)

can anyone help me here?
# 2  
Old 06-30-2003
rhost

insert hostname to .rhosts file. you can use rlogin instead of telnet.
# 3  
Old 07-01-2003
scripting telnet using 'expect'

Simplest I've found yet has been an expect script...
It exists on most unix machines in standard load, if not you may have to compile it...
In simplest terms, it does exactly what the name says, You type a command , you type what you "expect", it responds by continuing to the next line. Find a simple example below:

#! /usr/local/bin/expect -f
spawn tn rst41880
expect "login:"
send "{USER}\r"
expect "Password:"
send "{USER_PASSWORD}\r"
send "export DISPLAY={YOUR_HOSTNAME}:0\r"
send "{SUBSEQUENT_COMMANDS}\r"
interact
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Expect scripting telnet stop on bad username or password

I am trying to build and expect script to log into multiple aix boxes and change password. I need for the script to terminate if it cannot log into a server because the username or password is wrong. #!/usr/bin/expect set timeout 1 set host set user set password set uh "Unknown host" set... (3 Replies)
Discussion started by: leemalloy
3 Replies

2. UNIX for Dummies Questions & Answers

Difference Between Krb5-telnet And Ekrb5-telnet

Hi, I want to know the difference between these two services. Both are under xinetd. Both are used for enabling and disabling Telnet service. So, can somebody please explain me the difference between the two ? Thanks in advance :) (0 Replies)
Discussion started by: kashifsd17
0 Replies

3. Shell Programming and Scripting

Telnet using shell 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

4. UNIX for Dummies Questions & Answers

Automatically login in the telnet from present telnet

Hi, I was writing one script which includes to switch to the another telnet automatically from the present telnet server. I was using rlogin but firstly it takes the same user name of the present telnet and secondly it is prompting for the password. But i want to switch to the another telnet... (2 Replies)
Discussion started by: Prateek
2 Replies

5. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

6. Shell Programming and Scripting

BASH (or else) scripting for Telnet

Hi everybody, I am thinking on writing a shell script to telnet to Cisco routers, and I am looking for help. I have researched some and could not find much on the topic, or at least much of help anyway... I read "expect" is one solution, but I am looking for something more flexible, as I... (1 Reply)
Discussion started by: ppucci
1 Replies

7. Shell Programming and Scripting

Need Help on Telnet using PERL Scripting

Iam trying to connect to a system through Telnet using net::Telnet Module #!/usr/bin/perl -w use net::Telnet $myPassword = "abcdef"; $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die'); $telnet->open (10.10.20.00); $telnet->waitfor ('/USERCODE: $/i'); $telnet->print('abc');... (2 Replies)
Discussion started by: sudhakaryadav
2 Replies

8. Shell Programming and Scripting

Webpage to Telnet via Perl and Expect: Telnet problem?

Somewhat long story: I have a simple Perl CGI script that uses Expect to Telnet to a device and grab some data, and then spits it back to Perl for display on the Webpage. This works for many devices I've tried, but one device just fails, it keeps rejecting the password on this device, only... (1 Reply)
Discussion started by: jondo
1 Replies

9. Shell Programming and Scripting

Shell scripting with Telnet

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

10. UNIX for Dummies Questions & Answers

Telnet FTP scripting

Hi quick question from a unix newbie Working on a project to get me using unix, the point of this project is to find a printer on the network check for jobs in the printer if the printer has no jobs do nothing if the printer has jobs then check the status for errors and e-mail the user. This... (2 Replies)
Discussion started by: w33man
2 Replies
Login or Register to Ask a Question