Глава 17. Setting up an FTP server with YaST

Содержание

17.1. Starting the FTP server
17.2. FTP General Settings
17.3. FTP Performance Settings
17.4. Authentication
17.5. Expert Settings
17.6. For more information

Аннотация

Using the YaST FTP Server module, you can configure your machine to function as an FTP (File Transfer Protocol) server. Anonymous and/or authenticated users can connect to your machine and download files using the FTP protocol. Depending on the configuration, they can also upload files to the FTP server. YaST provides a unified configuration interface for various FTP server daemons installed on your system.

You can use the YaST FTP Server configuration module to configure two different FTP server daemons:

Only installed servers can be configured. Standard openSUSE® media do not contain the pure-ftpd package. However, if the pure-ftpd package is installed from another repository, it can be configured using the YaST module.

The vsftpd and pure-ftpd servers have slightly different configuration options, especially in the Experts Settings dialog. This chapter describes the settings of the vsftpd server , being the default server for openSUSE .

If the YaST FTP Server module is not available in your system, install the yast2-ftp-server package.

To configure the FTP server using YaST, follow these steps:

  1. Open YaST Control Center and choose Network Services+FTP Server or run the yast2 ftp-server command as root.

  2. If there is not any FTP server installed in your system, you will be asked which server to install when the YaST FTP Server module starts. Choose a server (vsftpd is the standard server for openSUSE) and confirm the dialog. If there are two servers installed, choose the preferred server and click OK.

  3. In the Start-Up dialog, configure the options for starting of the FTP server. For more information, see Раздел 17.1, «Starting the FTP server».

    In the General dialog, configure FTP directories, welcome message, file creation masks and various other parameters. For more information, see Раздел 17.2, «FTP General Settings».

    In the Performance dialog, set the parameters that affect the load on the FTP server. For more information, see Раздел 17.3, «FTP Performance Settings».

    In the Authentication dialog, set whether the FTP server should be available for anonymous and/or authenticated users. For more information, see Раздел 17.4, «Authentication».

    In the Expert Settings dialog, configure the operation mode of the FTP server, SSL connections and firewall settings. For more information, see Раздел 17.5, «Expert Settings».

  4. Press Finish to save the configurations.

17.1. Starting the FTP server

In the Service Start frame of the FTP Start-Up dialog set the way the FTP server is started up. You can choose between starting the server automatically during the system boot and starting it manually. If the FTP server should be started only after an FTP connection request, choose Via xinetd.

The current status of the FTP server is shown in the Switch On and Off frame of the FTP Start-Up dialog. Start the FTP server by clicking Start FTP Now. To stop the server, click Stop FTP Now. After having changed the settings of the server click Save Settings and Restart FTP Now. Your configurations will be saved by leaving the configuration module with Finish.

The Selected Service frame of the FTP Start-Up dialog shows which FTP server is used: either vsftpd or pure-ftpd. If both servers are installed, you can switch between them—the current configuration will automatically be converted. The pure-ftpd package is not included in the standard openSUSE media so you have to install it from a different installation source if you want to use it.

Рисунок 17.1. FTP Server Configuration — Start-Up

FTP Server Configuration — Start-Up

17.2. FTP General Settings

In the General Settings frame of the FTP General Settings dialog you can set the Welcome message which is shown after connecting to the FTP server.

If you check the Chroot Everyone option, all local users will be placed in a chroot jail in their home directory after login. This option has security implications, especially if the users have upload permission or shell access, so be careful enabling this option.

If you check the Verbose Logging option, all FTP requests and responses are logged.

You can limit permissions of files created by anonymous and/or authenticated users with umask. Set the file creation mask for anonymous users in Umask for Anonymous and the file creation mask for authenticated users in Umask for Authenticated Users. The masks should be entered as octal numbers with a leading zero. For more information about umask, see the umask man page (man 1p umask).

In the FTP Directories frame set the directories used for anonymous and authorized users. With Browse, you can select a directory to be used from the local filesystem. The default FTP directory for anonymous users is /srv/ftp. Note that vsftpd does not allow this directory to be writable for all users. The subdirectory upload with write permissions for anonymous users is created instead.

[Note]Write Permissions in FTP Directory

The pure-ftpd server allows the FTP directory for anonymous users to be writable. When switching between servers, make sure you remove the write permissions in the directory that was used with pure-ftpd before switching back to the vsftpd server.

17.3. FTP Performance Settings

In the Performance dialog set the parameters which affect the load on the FTP server. Max Idle Time is the maximum time (in minutes) the remote client may spend between FTP commands. In case of longer inactivity, the remote client is disconnected. Max Clients for One IP determines the maximum number of clients which can be connected from a single IP address. Max Clients determines the maximum number of clients which may be connected. Any additional clients will get an error message.

The maximum data transfer rate (in KB/s) is set in Local Max Rate for local authenticated users, and in Anonymous Max Rate for anonymous clients respectively. The default value for the rate settings is 0, which means unlimited data transfer rate.

17.4. Authentication

In the Enable/Disable Anonymous and Local Users frame of the Authentication dialog, you are able to set which users are allowed to access your FTP server. You can choose between the following options: granting access to anonymous users only, to authenticated users only (with accounts on the system) or to both types of users.

If you want to allow users to upload files to the FTP server, check Enable Upload in the Uploading frame of the Authentication dialog. Here you are able to allow uploading or creating directories even for anonymous users by checking the respective box.

[Note]vsftp—Allowing File Upload for Anonymous Users

If a vsftpd server is used and you want anonymous users to be able to upload files or create directories, a subdirectory with writing permissions for all users has to be created in the anonymous FTP directory.

17.5. Expert Settings

An FTP server can run in active or in passive mode. By default the server runs in passive mode. To switch into active mode, just uncheck Enable Passive Mode option in Expert Settings dialog. You can also change the range of ports on the server used for the data stream by tweaking the Min Port for Pas. Mode and Max Port for Pas. Mode options.

If you want encrypted communication between clients and the server, you can Enable SSL. Check the versions of the protocol to be supported and specify the DSA certificate to be used for SSL encrypted connections.

If your system is protected by a firewall, check Open Port in Firewall to enable a connection to the FTP server.

17.6. For more information

For more information about FTP servers read the manual pages of vsftpd and vsftpd.conf.