FTP Site Hosting

As part of your Corporate Web services and upon request, Panix provides you with a FTP site within your domain (ftp://ftp.yourdomain.com). This site will allow anonymous FTP file transfers within your domain.

To apply for a range of uids that will allow you to give people accounts on your FTP site, fill out this application, then continue reading this.

Setting up your FTP Site

When your Corp-Web FTP service is set up, Panix creates a link in your home directory called corp-ftp. The link is a shortcut to your FTP directory on the webserver, and you can treat it exactly like a directory.

When created, your FTP site has the following subdirectories:

It is up to you to create any other directories you require in your site. See creating directories for your users.

Panix will already have created the anonymous account, for non-privileged access to your FTP site. This means that anyone in the world can FTP to your site, log in as 'anonymous' and access certain directories and files you have set up as world-accessible.

The Commands

FTP site administration involves four commands. In all examples, <hostname> means the name of your ftp site. This means ftp.yourdomain.com, not yourdomain.com.

ftp_chown <hostname> (username|userid) [files]
ftp_chown changes the ownership of several files on the command line to the username or userid you specify. The files on the command line are specified relative the <hostname>'s root directory.
ftp_chmod <hostname> <permissions> [files]
ftp_chmod changes the permissions on a file owned by one of the users in <hostname>'s root directory according to the permissions you specify in the <permissions> parameter (an octal number with the same meanings as the octal number used by chmod(1))
ftp_passwd <hostname> [-u <user>]
ftp_passwd changes a password in the password file for a host. By default it will change the password of the person running the program. If the -u option is specified, it will change the password of the user after the -u parameter.
ftp_adduser <hostname>
ftp_adduser is an interactive program for adding a user to the password file for a host.

Deleting Users (AKA uids)


In order to delete users, you will employ our Panix Web Account Management Login tool. After you login, look for the "Web & FTP" section, and follow the link "Administer non-anonymous FTP" to delete users.

Other Commands

In order to effectively administer your FTP site, you must be familiar with a standard UNIX command or two, for creating directories in your FTP space and moving files into them. For full information on these commands, read the man page for them. You can do this by typing man <command> at a UNIX prompt.
mkdir <dirname>
mkdir creates a directory within the current working directory with the name <dirname>.

Examples

Here are some step-by-step examples of setting up a site, adding authorized users, and manipulating their files.

Creating Users

To allow someone password-protected access to your FTP site, you must create a userid for them. You do this using the ftp_adduser program.

Usage: ftp_adduser <hostname>
Your screen:What it does:
[panix-avery] <~> ftp_adduser ftp.justinthyme.com -- invoke the program.
Enter the username: renhoek -- enter the username you want to create.
Enter password: <invisible typing> -- the password will not show up when you type it.
Re-enter password: <invisible typing> -- make sure you got it right.
Enter the user's real name: Ren VanHoek -- give the user a real name.
Enter the user's home directory [/renhoek]: <enter> -- the default name for the user's directory is thier userid.
[panix-avery] <~> -- that's all.

This will create a user called 'renhoek', with the password you specify, who's directory on your site is '/renhoek'. When they log in, the server will place them in that directory.


Creating Directories

In order to organize your FTP site, you will probably want to create new subdirectories in it. You do this with the plain old mkdir command.

For example, you want a directory called pub, for files that you want anyone to be able to access, a directory called product, for files having to do with a product you develop, and perhaps subdirectories in product called v1 and v2 (for different versions of your product).
Usage: mkdir <dirname>
Your screen:What it does:
[panix-avery] <~> cd corp-ftp -- switch to the FTP site directory
[panix-avery] <~/corp-ftp> mkdir pub -- create the pub subdirectory
[panix-avery] <~/corp-ftp> mkdir product -- make the product subdirectory
[panix-avery] <~/corp-ftp> cd product -- switch to the new product subdirectory
[panix-avery] <~/corp-ftp/product> mkdir v1 -- make the v1 subdirectory
[panix-avery] <~/corp-ftp/product> mkdir v2 -- make the v2 subdirectory


Changing Ownership

Often you may wish to create a directory or file and make it specifically available to only one of your FTP users. When you do, you must change the ownership of the files/directories so FTP knows to whom to grant access and who to deny. You do this with the ftp_chown command.

Say you have a user called 'renhoek', and you just created a directory you want renhoek to have access to. (When you create the renhoek user, ftp_adduser automatically creates a directory in your FTP site with the same name as the user -- in this case, 'renhoek'. For the sake of this example, we're going to create a new directory for renhoek anyway.) You've also created two files you want to put in that directory for him. Assume the directory you want to create is called renspace, the two files for renhoek are called ren1.txt and ren2.txt. The files are currently in your maintenance account's home directory (not in your FTP space).

Here's how it would look from your maintenance account:
Usage:ftp_chown <hostname> (username|userid) [files]
Your screen:What it does:
[panix-avery] <~> cd corp-ftp -- switch to the FTP site directory
[panix-avery] <~/corp-ftp> mkdir renspace -- create the renspace directory
[panix-avery] <~/corp-ftp> cp ../ren1.txt renspace/ -- copy ren1.txt to FTP space subdir renspace
[panix-avery] <~/corp-ftp> cp ../ren2.txt renspace/ -- copy ren2.txt to FTP space subdir renspace
[panix-avery] <~/corp-ftp> ftp_chown ftp.justinthyme.com renhoek renspace -- make subdir renhoek owned by user renhoek
[panix-avery] <~/corp-ftp> ftp_chown ftp.justinthyme.com renhoek renspace/* -- make everything in subdir renhoek owned by user renhoek


Changing Permissions

Another thing you must do to make your FTP files and directories available is set permissions. By setting permissions, you can regulate what kind of users can list and download your FTP files, as well as who can remove files from your FTP site, or upload new files.

Continuing with the example from above, you have two files, ren1.txt and ren2.txt in the directory renspace. Both files and the directory they are in are owned by user 'renhoek'. You'd like the user renhoek (the authorized user)to be able to upload and delete files from the renspace directory, to download or delete ren1.txt, but only download ren2.txt. You'd also like anonymous users to be able to download the files in the renspace directory, but not be able to list them. This will let them download the files only if they know the full pathname (which they can't get from the FTP server).

Here's how to use ftp_chmod to set permissions:
Usage:ftp_chmod <hostname> (octal-number|text) [files]
Your screen:What it does:
[panix-avery] <~> cd corp-ftp -- switch to the FTP site directory
[panix-avery] <~> ftp_chmod ftp.justinthyme.com 701 renspace -- set access for directory renspace
[panix-avery] <~> ftp_chmod ftp.justinthyme.com 604 renspace/ren1.txt -- set access for file ren1.txt
[panix-avery] <~> ftp_chmod ftp.justinthyme.com 404 renspace/ren2.txt -- set access for file ren2.txt


Setting Passwords

Occationally you may want to change the passwords you've given your users. In particuar, if you want to login to your own FTP server via FTP, you must assign yourself a password, and you may want to change a user's password (for example, if a company officer leaves your employ and you wish to turn the account over to someone new).

You change a user's password with the ftp_passwd command:
Usage:ftp_chmod <hostname> (octal-number|text) [files]
Your screen:What it does:
[panix-avery] <~> ftp_passwd ftp.justinthyme.com -- set a password for yourself
Enter password:  <invisible typing> -- the password will not show up as you type it.
Re-enter password:  <invisible typing> -- make sure you got it right.
[panix-avery] <~> ftp_passwd ftp.justinthyme.com -u renhoek -- now change renhoek's password.
Enter password:  <invisible typing> -- the password will not show up as you type it.
Re-enter password:  <invisible typing> -- make sure you got it right.
[panix-avery] <~> -- all done.


To FAQ Index To Corp-Web FAQ index
To Top of Page To top of page

[ Panix Home ] [ Help System Index ] Wednesday, 01-Mar-2006 17:20:10 EST
©1997 - 2006 Public Access Networks Corp