Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl # file: telnet_a.pl use Net::Telnet; use Term::ReadKey; #connects to the server of your choice $telnet = Net::Telnet->new('osf1.gmu.edu'); #asks for login name with password print "Login Name : "; $HOST = <STDIN> or die print "not a valid name"; #reads in the password without showing the character #being typed in ReadMode("noecho",STDIN); print "Password : "; $USER = <>; print "\n"; #restor to normal settings ReadMode("original",STDIN); #connects to server $telnet->login($HOST,$USER) or die print "can't access server"; $telnet->cmd('ls');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: login remotely through telnet
by Elijah (Hermit) on Apr 01, 2004 at 17:43 UTC | |
|
Re: login remotely through telnet
by iburrell (Chaplain) on Apr 01, 2004 at 22:36 UTC |