Chinaunix首页 | 论坛 | 博客
  • 博客访问: 67681
  • 博文数量: 27
  • 博客积分: 1096
  • 博客等级: 少尉
  • 技术积分: 280
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-13 19:21
文章分类

全部博文(27)

文章存档

2011年(1)

2008年(26)

我的朋友

分类:

2008-07-14 11:18:29


1、先检查有没有安装net-ssh-perl
我先安装了
Net-SSH-Perl-1.30.tar.gz
Math-Pari-2.010709.tar.gz
Math-GMP-2.04.tar.gz
Crypt-DH-0.06.tar.gz
Crypt-DES-2.05.tar.gz
Convert-PEM-0.07.tar.gz
Crypt-DSA-0.14.tar.gz
pari-2.3.1.tar.gz这么多包,
安装方法,一般都是tar -zxvf package.tar.gz;cd package;perl Makefile.PL;make;make install.
2、ssh的脚本
[root@server1 root]# cat ssh.pl
#!/usr/bin/perl
use Net::SSH::Perl;
my $ssh=Net::SSH::Perl->new("YourIPaddress");
$ssh->login("youruser","yourpasswd");
my ($stdout,$stderr,$exit)=$ssh->cmd("you'll execute command in remote server");
但不知道为什么,如果远程服务器是solaris就可以,但linux就不行出现
Permission denied at ssh.pl line 5
而且执行成功的速度很慢,快1分钟了.
[root@server1 root]# time ./ssh.pl

real  0m37.322s
user  0m36.870s
sys   0m0.020s
阅读(2150) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~