VMmanager: Administrator guide

Example of FTP repository configuration

This article contains instructions on how to create and configure an FTP repository of ISO images with anonymous access.

To create a repository:

  1. Install the vsftpd FTP server: 

    AlmaLinux
    yum install vsftpd
    Ubuntu
    apt install vsftpd
  2. Create a root directory to store the repository files: 

    mkdir -p /srv/ftp/iso
  3. Check that an entry for the ftp user appears in the /etc/passwd file: 

    Пример записи
    ftp:x:139:149:ftp daemon,,,:/srv/ftp:/usr/sbin/nologin
  4. Specify the following settings in the /etc/vsftpd/vsftpd.conf configuration file: 

    listen=YES
    listen_ipv6=NO
    anonymous_enable=YES
    anon_root=/srv/ftp/iso/
    no_anon_password=YES
    local_enable=YES
    hide_ids=YES
    dirmessage_enable=YES
    use_localtime=YES
    xferlog_enable=YES
    connect_from_port_20=YES
    secure_chroot_dir=/var/run/vsftpd/empty
    pam_service_name=vsftpd
    ssl_enable=NO
    allow_writeable_chroot=YES
  5. Restart the vsftpd service: 

    systemctl restart vsftpd
  6. Copy an ISO image to the /srv/ftp/iso/ directory.
  7. Define the size of the ISO image in MiB: 

    ls -l --block-size=M <имя_файла>
    Output example
    -rw-rw-r-- 1 user user 389M May  5  2023 debian-11.7.0-amd64-netinst.iso
  8. Define the hash sum of the ISO image: 

    sha1sum <filename>
    Output example
    c0d269af8978c625cb480ba2c723c7964c7e52ad  debian-11.7.0-amd64-netinst.iso
  9. Create a repository description file /srv/ftp/iso/metadata.json. For more information about the file format, see ISO images repositories.

    Пример файла metadata.json
    {
      "type": "iso",
      "images": [
        {
          "name": "Debian 11",
          "os_type": "linux",
          "tags": [
              "linux", "debian"
                ],
          "file_name": "debian-11.7.0-amd64-netinst.iso",
          "image_size_mib": 389,
          "updated_at": "2024-06-05 00:00:01",
          "checksum": "c0d269af8978c625cb480ba2c723c7964c7e52ad"
        }
      ]
    }
  10. Specify access rights to the root directory of the repository: 

    chmod -R 775 /srv/ftp/iso
  11. Check access to the repository description file: 

    curl -v ftp://<server_IP>/metadata.json
    If the file cannot be accessed, check if the firewall settings allow incoming connections on ports 20/TCP and 21/TCP.
  12. Add a repository following the instructions in the ISO images repositories article.