Thread SSH: SSH Agent Forwarding + Authentication (6 answers)
Opened by Taulmarill at 2004-04-13 15:44

Snox
 2004-04-13 16:20
#38160 #38160
User since
2004-04-13
4 Artikel
BenutzerIn
[default_avatar]
Ok, ich hab's mal versucht, doch leider ohne Erfolg.

--- Source ---
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use strict;
use Net::SSH::Perl;
use Net::SSH::Perl::Agent;
use Net::SSH::Perl::Key;

my $agent = Net::SSH::Perl::Agent->new(1);
my $iter = $agent->identity_iterator;
while (my($key, $comment) = $iter->()) {
       ## Do something with $key.
print ("Key: " , $key , ":" , $comment ,"\n");
print ("test\n");
print ("-----------------------------------------\n\n");
my $host = "iksa-hop1";
my $user = "daitdsi";
my $ssh = Net::SSH::Perl->new($host);
$ssh->login($user);
my $cmd = "hostname";
my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
print ("Erster Host: $stdout\n");
$cmd = ". /home/daitdsi/.bashrc; ssh -i /home/daitdsi/.ssh/authorized_keys daitdsi\@appsvc1 hostname";
($stdout, $stderr, $exit) = $ssh->cmd($cmd);
print ("-----------------------------------------\n\n");
print ("Zweiter Host: $stdout\n");
print ("-----------------------------------------\n\n");
print ("err:\n$stderr\n");
print ("-----------------------------------------\n\n");
print ("exi:\n$exit\n");
}

exit(0);
\n\n

<!--EDIT|renee|1081861517-->

View full thread SSH: SSH Agent Forwarding + Authentication