Installing Pure-FTPd on SUSE Linux Professional
Novell Cool Solutions: Feature
By Kevin Millecam
Digg This -
Posted: 25 Jan 2005
If you want to add the ability for users to upload files -- via the File Transfer Protocol (FTP) -- to your SUSE Linux server, here are a few steps that will get you up and running.
- Start by launching YAST (K Menu => System => YAST).
- In the left pane of the YAST window, click "Software".
- In the right pane, click "Install and Remove Software".
- In the search field, type "FTP".
- Click "Search".
- From the search results, click the checkbox next to "pure-ftpd".
- Click "Accept" to initiate the installation process.
You will probably be asked to insert one of your install disks so YAST can grab the necessary files. Also, depending on your configuration, YAST might ask you to resolve some conflicts or to install some other packages that Pure-FTPd requires. This is one of the very cool things about SUSE Linux; YAST helps you uncover potential problems during the install process. If you're like me, this can save you hours (or maybe, days) in troubleshooting time.
- After the install is finished, I like to search (K Menu => Find) for the installed files to:
- see if anything was indeed installed
- get an idea where these new files are located
This trick comes in especially useful if you need to modify a configuration file or start up a related utility (stay tuned).
Much of the documentation I read listed different paths for the commands listed below. My guess is that the paths differ depending on which Linux distribution you are working with. The paths I'm using were arrived at after some trial and error (and several trips to the search results screen above). These paths work on SUSE Linux Professional 9.1.
Pure-FTPd comes with a host of configuration options that can be set at the command line or via the configuration file. I like the latter because I'm not fond of remembering (and typing) strings of cryptic commands. The configuration file also includes comments that do a good job explaining each of the available options.
- Browse to the configuration file (/etc/pure-ftpd/pure-ftpd.conf) and open it with a text editor like KWrite or Kate.
- You may be able to go with the default configuration. I had to make a small change before anything worked for me: I changed the "PureDB" path in the configuration file from "/etc/pure-ftpd/pureftpd.passwd" to "/etc/pure-ftpd/pureftpd.pdb"
- IMPORTANT: To tell Pure-FTPd to read the configuration file (instead of waiting for configuration commands from the command line), you must type this command in a terminal window:
- Locate or create a directory where you would like to house your FTP files. We're using /srv/ftp/. You'll need to make sure that the user we're about to create, "ftpuser" has rights to the FTP directory.
- As root, set up the "FTP Group" by issuing the following in a terminal window:
- Now, issue the command to set up the master "FTP User" in the group:
useradd -g ftpgroup -d /etc/pure-ftpd -s /etc ftpuser
- The -g switch designates what group the user will be a member of.
- The -d switch designates what directory the user has rights to.
- The -s switch is the name of the user's login shell (according to a brief Google search).
Before you go on to the next step, make sure ftpuser and ftpgroup have rights to the designated FTP directory (/srv/ftp/ in our case). To check the rights, browse to /srv/ftp/ and right-click on the ftp folder. Select "Properties" from the menu. Then click the "Permissions" tab. Here's a snapshot of what the permissions were on the ftp directory when I first checked them.
To change the permissions, simply type "ftpuser" and "ftpgroup" into the fields as shown. Be sure to check the "Apply changes to all subfolders and their contents" checkbox. This will ensure that as user subdirectories are created in the /srv/ftp/ directory, the proper rights will be inherited.
In this configuration, we will be issuing usernames and passwords for our FTP server, we will not be allowing anonymous logins. Pure-FTPd has the ability to manage Virtual Users*. These users don't actually exist as far as your SUSE Linux system is concerned. Pure-FTPd knows about the FTP users and manages their access. Before we set up users, we need to create a system FTP user and a system FTP group to which all virtual users will be associated. Literally thousands of virtual users can share the same system username as long as they have very limited rights (chrooted) and have their own home directory.
set up users
- As root, set up user phil by issuing this command in a terminal window:
pure-pw useradd phil -u ftpuser -d /srv/ftp/phil
(The default configuration will automatically create the folder /srv/ftp/phil/ the first time user phil logs in. This directive can be disabled in the configuration file.)
- After you've issued this command, pure-pw will ask you to provide and verify a password for the new user.
- Before this account is usable you need to commit your changes, issue the following command at your terminal prompt:
- To review the details of a user type the following at the terminal prompt:
pure-pw show phil
- To start the Pure-FTPd service (and set it up to start every time your server starts up), select "System" from the left pane of the YAST window.
- In the right pane, click "Runlevel Editor".
- In the window that opens, click the "Expert Mode" radio button.
- Scroll down the list of Services until you find "pure-ftpd"; select it with a single click.
- Using the "Set/Reset" pull-down, select "Enable the service".
- Using the "Start/Stop/Refresh" pull-down, select "Start the service".
- If all goes as planned, you'll see a new window (like the one below) that confirms the service has started.
- Be sure to click the "Finish" button before leaving the Runlevel Editor to save your changes.
test, test, test
To test my server, I stepped over to my Windows box and fired up the FTP client. I then tried to log into the server (using the IP address of the server machine) as FTP user "phil". This test helped me uncover a few problems with rights and configuration. It ended up being a good way to do some troubleshooting.
I'm new to this Linux world so if you see a problem with my technique or have a better way to do anthing I've described above, please send in your suggestions.
- Pure-FTPd Home
- PureAdmin Home (A graphical tool used to make the management of PureFTPd a little easier.)
- *More information on Virtual Users
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com