By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,279 Members | 1,670 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,279 IT Pros & Developers. It's quick & easy.

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

P: 1
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
Share this Question
Share on Google+
1 Reply


nithinpes
Expert 100+
P: 410
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

Post your reply

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