#!/usr/bin/perl use Net::SFTP; #use strict; #use warnings; $host = $ARGV[0]; $anonyuser = $ARGV[1]; if($ARGV[1] eq "-a") { $username = "anonymous"; $password = "-anonymous@"; } else { print("\nHost\/IP: "); $host = ; chomp ($host); print("\nUsername: "); $username = ; chomp ($username); print("\nPassword: "); $password = ; chomp ($password); } print("Connecting to $host...\n"); $ssh = Net::SFTP -> new($host) or die "Couldn't connect to $host\n"; print("Connected!\n"); print("\nSFC>"); $ssh->login($username, $password) or die "Could not log in .\n"; rep: $command = ; chomp ($command); unless ("$command" eq "bye") { @listing = $ssh->$command; for($i=0;$i<@listing;$i++) { print "$listing[$i]\n"; } print("SFC>"); #goto rep; } #### Permission denied at /usr/lib/perl5/site_perl/5.8.0/Net/SFTP.pm line 39