473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

how to telnet to a switch that without a username prompt?

Hello all,
I am using perl net::telnet to login remote switches by
$t->open($device);
$t->login($username, $password);
and everything goes on very well.

The problem is that now I have to telnet another switch that doesn't have a username prompt...which means only $password is needed when login...
but so far as i know that both username and pw are parameters of Telnet.pm login()....How can I login such kind of switch?

Thanks a lot!
Mar 26 '08 #1
1 7394
nithinpes
410 Expert 256MB
Hello all,
I am using perl net::telnet to login remote switches by
$t->open($device);
$t->login($username, $password);
and everything goes on very well.

The problem is that now I have to telnet another switch that doesn't have a username prompt...which means only $password is needed when login...
but so far as i know that both username and pw are parameters of Telnet.pm login()....How can I login such kind of switch?

Thanks a lot!
You can avoid using login(). Try using waitfor() method to wait for the prompt and print the password:

Expand|Select|Wrap|Line Numbers
  1. $t->open($device);
  2. $t->waitfor('/password: $/i');
  3. $t->print($password);
  4. ##
  5. $t->print('y');
  6.  
Mar 28 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: mnsindhu74 | last post by:
I want to implement telnet client in C#. I am able to connect to the telnet server in windows XP and do the negotiations. I also get the login prompt.After I send the username I get password...
2
by: eight02645999 | last post by:
hi i am using a telnet session to simulate an authentication mechanism USER = "user" PASSWORD = "password" try: telnet = telnetlib.Telnet(HOST) telnet.set_debuglevel(5)...
2
by: b00x | last post by:
Hi, I'm trying to develop a script that I can reuse to run remote commands on multiple UNIX servers via telnet. I've tried various php scripts after googling for a good 5 or so hours, but found...
13
by: Godzilla | last post by:
Hello, How do you create/spawn new processes in XP over telnet using python? I.e. I would like to create a new process and have it running in the background... when I terminate the telnet...
6
by: =?Utf-8?B?U2hhcmllZg==?= | last post by:
Dear All, I must write a client program in C# which will communicate with a switch throught telnet. When I create a socket connection on port 22, the switch responds with some text and at the...
4
by: pbd22 | last post by:
Hi I am making my way through a windows service that accepts custom telnet commands as strings and then parses the string and redirects it. This would be a custom string sent via telnet. ...
22
by: pbd22 | last post by:
Hi. I am building a custom telnet interface and my problem is that I want to read the user input along with the previously written stream. Right now I am logging the user. I have Login:...
1
by: thamayanthi | last post by:
Hi, Please find the below code which is used to Print the Operating System of a remote Machine of linux.This code is working fine,if i give the correct UserName and Password of a machine but what...
17
by: ravimath | last post by:
Dear all, I have written following script to loin to router bu it is showing error. #!c:\Perl\bin; use strict; use warnings; my $hostname = 'REMOVED FOR YOUR PROTECTION'; my $password =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.