- 論壇徽章:
- 1
|
本帖最后由 iakuf 于 2011-08-30 23:15 編輯
- use Net::SSH::Perl;
- use Net::SSH::Perl::Key::RSA;
- my $ip = '127.0.0.1';
- my $port = 22;
- my $user = 'root';
- my $ssh = new Net::SSH::Perl(
- $ip,
- port => $port,
- protocol => '2,1',
- debug => 1,
- identity_files => ["/root/.ssh/id_rsa"],
- options => [
- 'BatchMode yes',
- 'RSAAuthentication no',
- 'PubkeyAuthentication no',
- 'NumberOfPasswordPrompts 1',
- 'ChallengeResponseAuthentication no',
- 'PasswordAuthentication yes',
- 'UserKnownHostsFile /dev/null',
- ],
- );
- $ssh->login($user);
復(fù)制代碼 |
評分
-
查看全部評分
|