Operating System - HP-UX
1827458 Members
5633 Online
109965 Solutions
New Discussion

Re: Need help regarding FTP Implementation.

 
Umesh_1
Occasional Contributor

Need help regarding FTP Implementation.

Hi All,

I have a group of 6 people who are suppose to explore on networking concepts on unix.
As part of it we thought of developing a small FTP component. We have gone through the RFC 957 document and have a fair bit of idea on it. Can anybody let me know how to proceed on this further. Also need direction to the right references or documents, URLs. We would like to have look at the source code if available.

Thanks in advance.

Umesh
Simple
10 REPLIES 10
harry d brown jr
Honored Contributor

Re: Need help regarding FTP Implementation.

If you are looking for source code, then I suggest you look into getting a copy of linux (Redhat, Mandrake, Slackware, ...).


live free or die
harry
Live Free or Die
Steven Sim Kok Leong
Honored Contributor

Re: Need help regarding FTP Implementation.

Hi

For RedHat, you can download the source file packages by downloading the RPMs residing in the SRPMS subdirectory under the redhat parent directory via ftp.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Sridhar Bhaskarla
Honored Contributor

Re: Need help regarding FTP Implementation.

I strongly suggest them to read Internetworking with TCP/IP all the three volumes by Douglas E Comer. They have source codes for most of the protocols like rlogin, ftp etc.,

Also UNIX Network Programming by W Richard Stevens will also help a lot in understanding the TCP/IP layer on the unix.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Dave La Mar
Honored Contributor

Re: Need help regarding FTP Implementation.

For an ftp only user, I used the following two docs -
A5651654
NR0801KBRC00007714
Simple, straight forward.
Even a dummy like me could follow this.
dl
(search by document)
"I'm not dumb. I just have a command of thoroughly useless information."
Umesh_1
Occasional Contributor

Re: Need help regarding FTP Implementation.

Hi Dave,

I was not able to access these two documents.
A5651654
NR0801KBRC00007714
Let me know if I need to have additional permissions for accessing these documents.

regards,
Umesh
Simple
Rita C Workman
Honored Contributor

Re: Need help regarding FTP Implementation.

You can get information you need from Installing & Administering Internet Services (HP Manual..see www.hp.docs.com). Just watch out for the one error regarding copying pwd & ls:
copy pwd from /usr/bin/pwd
copy ls from /sbin/ls.

********
NOW FOR WHAT MOST FOLKS FORGET ! - NOT EVERYONE HAS ACCESS TO TECHNICAL DOCUMENTS !
*** SO CUT & PASTE DOCUMENTS INTO YOUR COMMENTS - LINKS TO US-SUPPORT ARE WORTHLESS FOR EUROPEAN USERS AND ANYBODY WHO HAS NOT PAID FOR THIS SERVE ***

I'll paste both Doc ID's below for you so this post is not so long..

Rgrds,
Rita



Rita C Workman
Honored Contributor

Re: Need help regarding FTP Implementation.


Date
: 2001 Aug 14
Description
: Attempting to delete a file within ftp gives permission denied
Document Id
: NR0801KBRC00007714

PROBLEM


After implementing restricted ftp sessions using document A5651654, the
restrictons work correctly but delete command gives permission denied.


Example:

$ ftp
ftp> open usap
Connected to usap
220 usap FTP server (Version 1.1.214.7 Thu Aug 10 09:57:38 GMT 2000) ready.
Name (usap:root): ftp022
331 Password required for ftp022.
Password:
230 User ftp022 logged in. Access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> asc
200 Type set to A.
ftp> put testfile
200 PORT command successful.
150 Opening ASCII mode data connection for testfile.
226 Transfer complete.
16 bytes sent in 0.00 seconds (23.78 Kbytes/s)
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for /usr/bin/ls.
total 6
-rwxrwxrwx 1 113 102 315 Jul 18 08:39 ap1trial.txt
-rw-rw-rw- 1 113 102 15 Aug 14 08:41 testfile
-rwxrwxrwx 1 113 102 315 Jul 18 08:25 exampleonly.txt
drwxrwxrwx 2 113 102 96 Jul 24 13:33 history
dr-xr-xr-x 3 113 102 96 Jul 31 09:18 usr
226 Transfer complete.

ftp> delete testfile
553 testfile: Permission denied. (Delete)
ftp>








RESOLUTION


Edit the /etc/ftpd/ftpaccess file

search for the line that starts with 'delete'

The line should look like:

delete no guest,anonymous # delete permission?

change the word no to yes

delete yes guest,anonymous # delete permission?


Permissions can be altererd in a similar method for the following operations:

- overwrite
- rename
- chmod
- umask

For more information on ftp and configuration options see the
Installing and Administering Internet Services Manual
HP Part Number: B2355-90685 available at www.docs.hp.com

Rita C Workman
Honored Contributor

Re: Need help regarding FTP Implementation.

 
A. Clay Stephenson
Acclaimed Contributor

Re: Need help regarding FTP Implementation.

Hi:

One source of ftp source code is available from http://www.freebsd.org. Another source set to examine is perl especially the Net::Ftd module source. It has almost every feature covered including error checking. You can get the source for this at http://www.perl.org/CPAN.

As part of your learning execise, you might even consider using Perl rather than C in that, believe it or not, you have nearly the power of C with a fraction of the development time. Moreover, because the perl calls are so similar to the underlying C functions/system calls, the knowledge transfers very well.


Regards, Clay
If it ain't broke, I can fix that.
Christopher Caldwell
Honored Contributor

Re: Need help regarding FTP Implementation.

Client source (FreeBSD)is available from
ftp://ftp.uu.net/pub/OS/bsd-sources/usr.bin/ftp/

Server source is available from
http://www.wu-ftpd.org