Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Multiple scp targets?




Any suggestions? Is there scp syntax to support this? Or a way to
remember the password? (but securely!)

While, like Stephen suggested, using key's with timeouts is probably a better idea you could always use a little perl/expect foo.

#!/usr/bin/perl -w


use strict;
use Net::SCP::Expect;
use Term::ReadKey;
ReadMode('noecho');


my @dirs = ("/tmp", "/home/romeo");

print "Enter password: ";
my $password = ReadLine(0);



for my $i (@dirs) {
        my $scpe = Net::SCP::Expect->new;
        $scpe->login("romeo", "$password");
        $scpe->scp('/tmp/testfile', "melon:${i}");
}

ReadMode 0;
 

--
Romeo Theriault


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links