FTP

From Peyton Hall Documentation
Jump to navigation Jump to search

Files over a MB or two shouldn't be emailed around, since they tend to clog inboxes and mail servers (and it's really not nice to those who don't have broadband access, or perhaps are using a slower network connection). The two solutions are to put the file in your web page somewhere, or put it out for FTP download. Your home page is the recommended way of serving files, as there's more security options available, but some people prefer FTP and thus it is available if needed.


FTP setup

Downloading

For security reasons, FTP connections are limited to anonymous FTP. If you wish persons to be able to access files via anonymous FTP, place the files in the directory "~/public_ftp". This directory should be owned by you, and have permissions set to 0755 (drwxr-xr-x). To access to your FTP area, ftp to ftp.astro.princeton.edu (or use a web browser to connect to ftp://ftp.astro.princeton.edu/). Your area will be in "/<your username>". Note that if you just do a 'ls' when logging in, you may not see your directory. However, typing 'cd <username>' will make the directory visible.

If you want to have files in multiple locations (such as your web site and your FTP directory) then you can use hard links to them; for example, from your public_ftp directory, "ln ~/WWW/public/somefile.sh" will hard link 'somefile.sh' from your web site to your FTP site. This does not take up any additional space.


Uploading

For people to be able to upload files to you, there should be a directory named "incoming" in your FTP area, with permissions set to 2733 (drwx-ws-wx). This is so that people can upload files to that area, but not subsequently download them again. Allowing anyone to see the files in your incoming area can cause problems with people who would then upload things like illegal software, porn, or other undesirable files, and others would be able to download them. Essentially you become a mirror site for anyone's junk. Granted, you can delete the files, but most "script kiddies" will test the FTP server's capabilities first; upon seeing that they can't download from your incoming directory, they'll pass it over for someone else's.

Uploaded files will be owned by the 'ftp' user, and your group. You cannot change ownership or permissions of the files, though you can modify and view them. If you want to do something else with them, then first run a 'cp' to copy the file to another location, and delete the original. The copied file will be owned by you and fully editable. This is a side effect of the FTP daemon's uploading the file to you.