Help for this page

Select Code to Download


  1. or download this
    use Net::SSH::Perl;
    
    my $keyfile='~/.ssh/known_hosts';
    my $ssh = Net::SSH::Perl->new( $host, options => ["UserKnownHostsFile 
    +$keyfile"] );
    
  2. or download this
    #!perl
    
    ...
    #dd $ssh;                               # use this when debugging the 
    +various %options
    $ssh->login($username) or die "login: $!";  # using id_rsa identificat
    +ion, at default id_rsa location, or ask for pw if it fails
    print map { $_//"<undef>\n", "\n----\n"} $ssh->cmd('pwd');