Thu 28 Dec 2006
Using Your FTP Server Configuring for anonymous FTP server file upload Creating a system account for per-user access to the FTP server Disabling local system user accounts Blocking FTP access for user accounts We’ll also show you how to configure an FTP greeting banner. Configuring an Anonymous FTP Server for File Download Anonymous users cannot read from just any directory on your Linux server. By default, the vsftpd package creates a directory tree starting at /var/ftp, and enables ‘anonymous read access’ to this directory and the directory structure beneath it. To demonstrate this, we’ll start by placing a test file on the FTP server so that other users can download it. Then, we’ll adopt the role of one of these users, and run a client FTP session to access the FTP server, examine the contents of the FTP site, and download a copy of the test file. Setting up the FTP Server All we need to do here is place some test content somewhere under the /var/ftp directory, so that other users can access it. The owner of the /var/ftp is the root account, and by default is the only one with permission to write to the directory (recall from Chapter 8 that the owner, group, and others can all have different privileges on a directory or file). So to start, use a command line to switch to the root user: $ su - Password: Then you can place whatever content you want under the /var/ftp directory. For example, you can easily use a command such as echo to create a simple test file: # cd /var/ftp/pub # echo “This is the contents of a test file!” > test.txt Here, we’ve created the file test.txt and placed it in the /pub subdirectory. Using an FTP Client to Test Anonymous Read Access Now you can test for anonymous read access, by using an FTP client to try to grab a copy of this test file via an FTP connection. You can use any FTP client, and you can test from a Windows or Linux machine - provided the client machine can see the FTP server across a network. (You can even use your Linux server as a client, if you have only one machine.) For example, in both Windows and Linux you can use the ftp program at the command line. In the following, we’ll use the ftp program as FTP client to connect to the FTP server, examine the contents of the FTP site, and then download the file test.txt: 1. Start by connecting to the FTP server. When you’re prompted for a username, specify anonymous (as shown below) or ftp to indicate that you want anonymous access: 281
Note: If you are looking for good and quality webspace to host and run your java application check professional java hosting services