07-02-2001
Perl, Pipes, and FTP
I am attempting to automate an ftp session in PERL by emulating the user and sending commands to ftp, but I am getting unexpected and unwanted results. Here is a portion code that illustrates the method I am attempting (this was just a shot in the dark):
system("(
echo open server
sleep 1
echo username
sleep 1
echo password
sleep 1
echo ls) | ftp");
The ftp server doesn't appear to be interpretting the commands, and it appears to hang up somewhere around the username/password entry. Any help would be appreciated.
Thanks.
Bryan Murdaugh
10 More Discussions You Might Find Interesting
1. Filesystems, Disks and Memory
Hello!
How I can increase or decrease predefined pipe buffer size?
System FreeBSD 4.9 and RedHat Linux 9.0
Thanks! (1 Reply)
Discussion started by: Jus
1 Replies
2. Shell Programming and Scripting
Hi all,
I am trying to download a build from an ftp server.
My problem is that my build contains sub folders and files within the sub folders.
I can ftp a single file at a time, but it will be difficult to specify all the paths and download individula files.
My build structure is:
... (2 Replies)
Discussion started by: gurukottur
2 Replies
3. Shell Programming and Scripting
Hello,
I have a program which opens a pipe for communication using file handle and forks 5 child processes.
@waitlist = (1,2,3,4,5);
foreach $item (@waitlist) {
pipe *{$item},RETHAND;
unless ($pid = fork()) {
# Child process
print RETHAND... (1 Reply)
Discussion started by: the_learner
1 Replies
4. Shell Programming and Scripting
Hi All, i want to have a ftp function in my perl but i am unfamailiar with the perl syntax. Can any body help ?
The ftp code below is in csh, can anybody help to convert this to perl with the same functionality ?
foreach t (10.10.10.10 20.20.20.20)
set USER = "xxx"
set PASS = "zzz"... (21 Replies)
Discussion started by: Raynon
21 Replies
5. Shell Programming and Scripting
My situations is I cannot use NET::ftp. So I need to have a way to automate ftp. I know how to do it in ksh:
#!/usr/bin/ksh
ftp -i -v -n $host_name <<_FTP >> $log_file 2>&1
user $user_name
lcd $local_dir
cd $remote_dir
put $file_name
bye
_FTP
But how can I do it in perl?
Note:... (6 Replies)
Discussion started by: egyfan
6 Replies
6. Shell Programming and Scripting
Hi,
I am using NET::FTP in perl to tranfer files.
i have an array of files
and then I m getting one bye one using foreach.
the problem is I m not gettng the complete list of files.
the program terminates after 2 files.
when I execute again it will transfer the remaining 2 files. (... (3 Replies)
Discussion started by: shellwell
3 Replies
7. Shell Programming and Scripting
Hi,
I have three files in this /home/mani/ location. I would like to ftp to another server.
could you please give perl for that requirement.
Thanks,
Mani (10 Replies)
Discussion started by: Mani_apr08
10 Replies
8. HP-UX
Hello All,
I am trying to connect to ftp server and get the files. Also i need to rename the file in other ftp dir.
rename method is not allowing me to rename the file in other dir. When i tried copy command by using net::FTP:FILE then perl says it is not installed.
Can some body help me to... (2 Replies)
Discussion started by: krsnadasa
2 Replies
9. Shell Programming and Scripting
Hi,
Can anyone help me to start a monitoring script in perl of a FTP server. (2 Replies)
Discussion started by: phanik143
2 Replies
10. Shell Programming and Scripting
i want to upload two different files in to two different directories(path) on ftp server.but i am able to ftping only one at a time :(.. not both simultaneously.
here i have connectd the ftp and use the binary mode to transfer the files
$ftp = Net::FTP->new($ftphost, Debug => 0)
or... (2 Replies)
Discussion started by: aarts
2 Replies
LEARN ABOUT DEBIAN
pam_ftp
PAM_FTP(8) Linux-PAM Manual PAM_FTP(8)
NAME
pam_ftp - PAM module for anonymous access module
SYNOPSIS
pam_ftp.so [debug] [ignore] [users=XXX,YYY,...]
DESCRIPTION
pam_ftp is a PAM module which provides a pluggable anonymous ftp mode of access.
This module intercepts the user's name and password. If the name is ftp or anonymous, the user's password is broken up at the @ delimiter
into a PAM_RUSER and a PAM_RHOST part; these pam-items being set accordingly. The username (PAM_USER) is set to ftp. In this case the
module succeeds. Alternatively, the module sets the PAM_AUTHTOK item with the entered password and fails.
This module is not safe and easily spoofable.
OPTIONS
debug
Print debug information.
ignore
Pay no attention to the email address of the user (if supplied).
ftp=XXX,YYY,...
Instead of ftp or anonymous, provide anonymous login to the comma separated list of users: XXX,YYY,.... Should the applicant enter one
of these usernames the returned username is set to the first in the list: XXX.
MODULE TYPES PROVIDED
Only the auth module type is provided.
RETURN VALUES
PAM_SUCCESS
The authentication was successful.
PAM_USER_UNKNOWN
User not known.
EXAMPLES
Add the following line to /etc/pam.d/ftpd to handle ftp style anonymous login:
#
# ftpd; add ftp-specifics. These lines enable anonymous ftp over
# standard UN*X access (the listfile entry blocks access to
# users listed in /etc/ftpusers)
#
auth sufficient pam_ftp.so
auth required pam_unix.so use_first_pass
auth required pam_listfile.so
onerr=succeed item=user sense=deny file=/etc/ftpusers
SEE ALSO
pam.conf(5), pam.d(5), pam(7)
AUTHOR
pam_ftp was written by Andrew G. Morgan <morgan@kernel.org>.
Linux-PAM Manual 06/04/2011 PAM_FTP(8)