- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Telnet whith Automatic logon
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2003 01:47 AM
02-10-2003 01:47 AM
How can I can do to use telnet to remote host (cisco router) using automatic username and password. for exemple:
telnet username@password host
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2003 01:54 AM
02-10-2003 01:54 AM
Re: Telnet whith Automatic logon
For systems you can use ssh
To login to Cisco router, i don't think you can use ssh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2003 01:54 AM
02-10-2003 01:54 AM
Re: Telnet whith Automatic logon
#!/bin/sh
(sleep 5
echo
sleep 5
echo
sleep 5
echo ls
sleep 5
echo exit) |telnet
YOu can do things better with PERL.
Wait until people like Procura replies.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2003 02:11 AM
02-10-2003 02:11 AM
Re: Telnet whith Automatic logon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2003 02:18 AM
02-10-2003 02:18 AM
Re: Telnet whith Automatic logon
Just modify as
#!/bin/sh
(sleep 5
echo
sleep 5
echo exit) |telnet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2003 02:32 AM
02-10-2003 02:32 AM
Re: Telnet whith Automatic logon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2003 02:51 AM
02-10-2003 02:51 AM
Solutionexpect can be downloaded from software.hp.com
expect comes from :
http://expect.nist.gov/
Take a look there
Regards
Rainer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2003 06:40 AM
02-10-2003 06:40 AM
Re: Telnet whith Automatic logon
You need to get a program called expect, which will allow you to script where waiting for stdin.
Regards,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2003 07:25 AM
02-10-2003 07:25 AM
Re: Telnet whith Automatic logon
use Net::Telnet::Cisco;
@swlist=(1,11..16,18,19,20,22,30);
%nouse=(1,1,18,1,15,1,30,1);
# 18,19 can not be telnet'd into from hpux?
foreach $ip4 (@swlist) {
next if $nouse{$ip4};
$ip="172.16.0.$ip4";
my $cs = Net::Telnet::Cisco->new( Host => $ip );
if ($ip4 eq "1") {
$cs->login( 'login', 'apasswd' ); # Do PIX firewall
$ok=$cs->enable("apasswd2"); # enable priv mode
my @cmd_output = $cs->cmd( 'no pager' ); # Turn off paging
} else {
$cs->login( 'login', 'apasswd3' ); # Do reg switch
my @cmd_output = $cs->cmd( 'terminal length 0' ); # Turn off paging
}
# Execute a command
@cmd_output = $cs->cmd( 'show tech-support' );
map s/^/$ip4>/, @cmd_output;
print @cmd_output;
$cs->close;
}
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2003 09:36 AM
02-10-2003 09:36 AM
Re: Telnet whith Automatic logon
You can get the secure shell depot for free from software.hp.com. I wrote a document on how to implement it, which I've attached (it seems to be popular).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2003 01:32 AM
02-11-2003 01:32 AM
Re: Telnet whith Automatic logon
My script:
#!/bin/sh
# exec expect "$0" ${1+"$@"}
set host [lindex $argv 0]
set login [lindex $argv 1]
set password [lindex $argv 2]
spawn telnet $host
expect "Username:"
send "$login\r"
expect "Password:"
send "$password\r"
interact
Thanks for all...
Ivan