pinnacle has asked for the wisdom of the Perl Monks concerning the following question:
I am unable to ssh into *nix box, it always says: "Net::SSH: Bad host name: tic-rhel5-20-12" when I check hostname on box it says
[root@tic-rhel5-20-12 ~]# hostname tic-rhel5-20-12
CODE:
#!/usr/bin/perl use Net::SSH::Perl; use strict; my $host = "tic-rhel5-20-12"; my $user = "ssh root\@10.10.20.12"; my $passwd = "test"; my $cmd = "ls -l /root"; my $ssh = Net::SSH::Perl->new($host); my $ssh->login($user,$passwd); print "looking..."; my ($output, $error, $exit) = $ssh->cmd("$cmd"); print "Result:\n"; print $output;
Please help, Thanks!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unable to ssh in linux box
by choroba (Cardinal) on May 12, 2011 at 15:00 UTC | |
by pinnacle (Acolyte) on May 12, 2011 at 15:23 UTC | |
|
Re: Unable to ssh in linux box
by Khen1950fx (Canon) on May 12, 2011 at 16:32 UTC | |
by pinnacle (Acolyte) on May 12, 2011 at 17:14 UTC | |
by Anonymous Monk on May 12, 2011 at 17:55 UTC | |
|
Re: Unable to ssh in linux box
by BradV (Sexton) on May 12, 2011 at 16:08 UTC | |
|
Re: Unable to ssh in linux box
by Anonymous Monk on May 12, 2011 at 16:16 UTC |