|
Your
users may occasionally need to upload files to your FTP
server. If you allow FTP uploads, you should confine these
uploaded files to an incoming or customer-accessed
directory.
Note: If you do
not allow file uploads, you do not need to create an
incoming directory.
Allow your users write-only
permissions in the incoming directory. Allowing users
write-only permission (and not read or execute permission)
prevents them from changing or deleting others' uploaded
files. If users have read permissions on the incoming
directory, they could upload potentially embarrassing
or illegal files where other users could access them.
Making an incoming
Directory
- From your ftp/pub
directory, create a directory named incoming:
% mkdir ftp/pub/incoming
- In the ftp/pub/incoming
directory, create a file called .incoming (do
not forget the ".").
The .incoming
file flags the directory as a write-only directory.
Creating Logon Banners
and Directory Messages
Some FTP servers display
messages immediately following user logon. These messages
give the user helpful information about the FTP site
that they are accessing and are called logon banners.
Directory messages act
in the same way. When a user accesses a particular directory,
a message is displayed. The message usually contains
information about what is in the directory as well as
any cautions regarding system files.
Creating a Logon Banner
- In your ~/ftp/pub
directory, create a file named .welcome.
- In the .welcome
file, enter the text that you want the user to
see.
The following is an example
logon banner found on an FTP server:
Welcome to ACME Rockets
Inc Anonymous FTP Server!
Please send any questions
or reports about this server to ftp@acme-rockets.com.
Creating a Directory
Message
Create a file named .message
in the directory where you want the message to appear.
The text message you create in the .message file
displays when the user accesses that directory.
For example, you could
promote a demo version of your company's software in
the DEMO directory with a .message file
containing the following text:
This directory contains
demo versions of ACME Rocket's products:
missile.zip - Missile
CAD(tm) Version 1.0 (DEMO)
nuke.zip – Thermo-Nuclear War Simulator(tm) Version
2.1 (DEMO)
Creating Non-Anonymous
FTP Accounts
If you configure your
Virtual Server to handle non-anonymous FTP accounts,
you can easily add FTP accounts for some users. Adding
FTP accounts enables you to control who uploads or downloads
the following:
- Web content
- Files in the anonymous
FTP file area
- Files in the private
FTP upload/download directories
Note: Most customers
use non-anonymous FTP on their Virtual Servers. Customers
can then resell server space to clients, which enables
them to maintain their own home pages. Also, companies
who want to restrict downloads of valuable information
can use password-restricted anonymous FTP.
The procedure for adding
non-anonymous FTP accounts is similar to the procedure
for adding POP mail accounts. When you create the FTP
account, the server automatically creates an e-mail
POP account for the user. If you do not wish the user
to access e-mail on your server, do not tell the user
about the e-mail account.
Adding Non-Anonymous
FTP Accounts
- From a Telnet prompt,
type vadduser. This action displays a series
of fields to fill in after beginning with the following
command example:
% vadduser
Please supply answers
to the series of questions below. When a `default
answer' is available, it will follow the question
in square brackets. For example, the question:
What is your
favorite color? [blue]:
has the default answer
`blue'. Accept the default (without any extra typing!)
by pressing the Enter key -- or type your answer
and then press <Enter>.
Use the <Backspace>
key to erase and aid correction of any mistyped
answers -- before you press <Enter>. Generally,
once you press <Enter> you move onto the next
question.
Once you've proceeded
through all the questions, you will be given the
option of modifying your choices before any files
are updated.
Press <Enter>
to continue:
- Type the username.
- Type the E-mail/FTP
Password.
- Retype new password.
- Type the User's Full
Name followed by a return. Use 8 characters or fewer,
no "." characters, and no ':' characters.
- Select the account
services that the new users will require. The default
selections are FTP and e-mail. Type the service name
(FTP or e-mail) to toggle the selected/deselected
services for the account.
- FTP (File Transfer
Protocol) for uploading/downloading files
- E-mail services including
POP, IMAP, and SMTP
Note: If the user
account will be accessed via IMAP, then FTP service
must be enabled.
- Enter a positive
or negative response to the question "Do you
want to add service options like quotas to this account?"
- Enter ftp quota for
this account in MB (enter "0" for no quota).
- Enter a numerical
response for the question "Where would you like
to put the user's home directory?" You are given
four options for where to put the user's home directory,
or you can put it in any location you choose. The
table below lists and describes each location briefly.
|
Description |
Example |
|
Email account home
directory |
/usr/home/username |
|
Web hosted account
directory |
/usr/local/etc/httpd/htdocs/username |
|
Virtual hosted
account directory |
/usr/local/etc/httpd/htdocs/vhosts/username |
|
Anonymous FTP home
directory |
/ftp/pub/username |
|
Your choice |
/usr/local/etc/httpd/htdocs/vhosts/some_directory/username |
- Enter "1"
for an E-mail account home directory.
- Enter "2"
for a web-hosted account home directory.
- Enter "3"
for a virtual hosted account.
- Enter "4"
for an anonymous FTP home directory.
- Or enter in any custom
path.
Note: Running
the vadduser script is straightforward with one
exception: the account services (FTP and e-mail). These
services are added to each user's account by default.
If you want the user to have both FTP and e-mail privileges,
press <enter> when asked to accept the defaults.
For the user to have FTP privileges only, deselect the
mail privileges by entering "mail." For the
user to have e-mail privileges only; deselect the ftp
privileges by entering "ftp." If you need
to add a service not currently in the list enclosed
by the square brackets ([]), then type the service (e-mail
or FTP) and press the Enter key.
For example, if Mary
Smith has the account name "mary" and the
domain name associated with your Virtual Server is "yourcompany.com,"
then Mary's e-mail address would be "mary@yourcompany.com".
Note: The FTP
quota governs the space that may be consumed by the
entire directory tree of a user's home directory. The
FTP quota is only effective when using FTP to upload
files. The mail quota governs the space that may be
consumed by a user's mail file under ~/usr/mail.
Each quota is expressed as a decimal integer number
of megabytes (MB) of disk space.
User Home Directory
Options
You have several options
for setting the user home directory. Each of these options
allows you to control how the user accesses the Virtual Server.
The first option allows
you to create the home directory under your /usr/home
directory. This option is best for users who have no
special use requirements. If the directory were called
test, it would be created at /usr/home/test.
This would be an ideal place for you to create an FTP
directory for users to upload information to your server.
From the test directory, your system administrator
could then verify and place the file(s) in the proper
directory structure.
The second option allows
you to create the home directory under your /usr/local/etc/httpd/htdocs
directory. If the directory were called test,
it would be created at /usr/local/etc/httpd/htdocs/test.
This option is best for users who upload their own web
pages. The users would have FTP access to the test
directory and sub-directories they created. However,
the users could not access anything above the test
directory. The user's home pages would be located at
http://www.yourcompany.com/test.
The third option allows
you to create the directory in the vhosts directory
(/usr/local/etc/httpd/vhosts/username),
which is used for storing files for any virtual subhosts
you have created. This option would allow users to have
access to their virtually hosted files but not to virtually
hosted files of any other users. If you have virtual
subhosts on your Virtual Server, or if you plan to have
them, we recommend this option.
The fourth option allows
the user to upload files to your anonymous FTP archive.
The directory created for the user test would be /ftp/pub/test.
Files in this directory could only be added and deleted
by the user test, but anyone would have access
to download these files.
The FTP upload quota
allows you to limit how much of your Virtual Server's
disk space one of your users may use. If the user attempts
to upload more data than their remaining quota allows,
they receive an FTP error message.
|