Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: Unix 2 Perl Module FTP

by simbalion (Initiate)
on Sep 28, 2012 at 21:06 UTC ( #996296=note: print w/replies, xml ) Need Help??


in reply to Re^3: Unix 2 Perl Module FTP
in thread Unix 2 Perl Module FTP

I have simplified the module to this: #!/usr/bin/perl use Net::FTP; $ftp = Net::FTP->new("9.9.9.9 5000", Debug => 0) or die "Cannot connect to some.host.name: $@"; $ftp->login("Domain\\user1",'password321') or die "Cannot login ", $ftp->message; $ftp->quit; for the domain I have tried: Domain\user Domain\\user Domain\/user Domain/user Nothing will work guys. Error received: Cannot login Invalid userid/password

Replies are listed 'Best First'.
Re^5: Unix 2 Perl Module FTP
by Mr. Muskrat (Canon) on Sep 29, 2012 at 15:21 UTC

    You said that user1@FQDN worked from the FTP client but you didn't say that you've tried it from your Net::FTP script. Also, double check that you have the right password in your script.

    #!/usr/bin/perl use strict; use warnings; use Net::FTP; my $ftp_site = '9.9.9.9 5000'; my $ftp_dir = '/Directory2'; my $ftp_get_file = 'that.file'; my $ftp_user = 'user1@FQDN'; # if 'DOMAIN/user1' and 'DOMAIN\\user +1' don't work, perhaps this will my $ftp_password = 'password321'; # double check your password, maybe +it's the problem! my $ftp = Net::FTP->new($ftp_site) or die "Could not connect to $ftp_site: $@"; $ftp->login($ftp_user, $ftp_password) or die "Could not login to $ftp_site with user $ftp_user: ", $ftp-> +message; $ftp->cwd($ftp_dir) or die "Could not change remote working directory to $ftp_dir on $f +tp_site: ", $ftp->message; $ftp->get($ftp_get_file) or die "Could not get $ftp_get_file the file is not present in $ftp +_dir: ", $ftp->message; $ftp->quit();

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996296]
help
Chatterbox?
[Lady_Aleena]: Your Mother, that's the command line grep, not perl's grep.
[Your Mother]: …how on Earth could Perl’s grep recurse?
[Tanktalus]: perldigious: I'm not looking to get rich. I'm looking for interesting work, with good continuity of employment, and maintenance of our current lifestyle. (An improvement wouldn't be bad, either, but that's not a requirement ;) )
erix enjoys the confusion++
[Your Mother]: :P
[Tanktalus]: Without confusion, I'd be out of a job ;)
[Tanktalus]: Already. :D
[Lady_Aleena]: Your Mother, I wish it did have a way to put in a directory to search.
[Your Mother]: That’s silly. It’s a string op tool.
[Lady_Aleena]: So I guess I'll go argue with File::Find and grep.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (11)
As of 2017-05-23 19:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?