I need to parse password during find a file in remote linux system, how can I read a remote directory in linux?
I tried one:
ssh [email protected] "find /var/www/home" sshpass -p pass
it didn't work properly in linux, if any one face this solution, please let me know...
I tried two:
opendir(IN, "[email protected]:/var/www/home") || die "can't open !";
I tring also perl but it didn't work properly,
How can I start? How can I read a remote directory?
use Net::SFTP::Foreign.
use Net::SFTP::Foreign;
my $sftp = Net::SFTP::Foreign->new($host, user => $user, password => $password, autodie => 1);
my $ls = $sftp->ls($dir);
use Data::Dumper;
print Dumper($ls);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With