uftp-server-installation
Differences
This shows you the differences between two versions of the page.
— | uftp-server-installation [2025/08/17 16:12] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | **uFTP - FTP server installation** | ||
+ | |||
+ | **Option 1 install from sources (recommended)** | ||
+ | |||
+ | Some software are required for this procedure: git, gcc and make, check your Linux distribution documentation for more information about how to get the required software. | ||
+ | |||
+ | Eg: | ||
+ | Under **Ubuntu/ | ||
+ | < | ||
+ | # sudo apt-get install git gcc make | ||
+ | </ | ||
+ | |||
+ | Clone the repository: | ||
+ | < | ||
+ | # git clone https:// | ||
+ | </ | ||
+ | |||
+ | **Compile uFTP server** | ||
+ | |||
+ | < | ||
+ | # cd uFTP | ||
+ | </ | ||
+ | |||
+ | **Note:** To enable the large file support, the Makefile file must be edited, find in the file the text that starts with DEFINITIONS= and modify the file as the example below. | ||
+ | < | ||
+ | DEFINITIONS= | ||
+ | #TO ENABLE THE LARGE FILE SUPPORT UNCOMMENT THE NEXT LINE | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | Remove the comment at the line: | ||
+ | # | ||
+ | |||
+ | The final result would be: | ||
+ | < | ||
+ | DEFINITIONS= | ||
+ | #TO ENABLE THE LARGE FILE SUPPORT UNCOMMENT THE NEXT LINE | ||
+ | DEFINITIONS=-D_LARGEFILE64_SOURCE | ||
+ | </ | ||
+ | |||
+ | **Note:** To enable TLS/SSL find the following lines in the Makefile file. | ||
+ | < | ||
+ | ENABLE_OPENSSL_SUPPORT= | ||
+ | #TO ENABLE OPENSSL SUPPORT UNCOMMENT NEXT 2 LINES | ||
+ | # | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | Remove the comments at the lines: | ||
+ | < | ||
+ | # | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | The final result would be: | ||
+ | < | ||
+ | ENABLE_OPENSSL_SUPPORT= | ||
+ | #TO ENABLE OPENSSL SUPPORT UNCOMMENT NEXT 2 LINES | ||
+ | ENABLE_OPENSSL_SUPPORT=-D OPENSSL_ENABLED | ||
+ | LIBS=-lpthread -lssl -lcrypto | ||
+ | </ | ||
+ | |||
+ | **Note:** To enable the PAM Authentication module for the standard / | ||
+ | < | ||
+ | ENABLE_PAM_SUPPORT= | ||
+ | PAM_AUTH_LIB= | ||
+ | #TO ENABLE PAM AUTH UNCOMMENT NEXT TWO LINES | ||
+ | # | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | Remove the comments at the lines: | ||
+ | < | ||
+ | # | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | The final result would be: | ||
+ | < | ||
+ | ENABLE_PAM_SUPPORT= | ||
+ | PAM_AUTH_LIB= | ||
+ | #TO ENABLE PAM AUTH UNCOMMENT NEXT TWO LINES | ||
+ | ENABLE_PAM_SUPPORT= -D PAM_SUPPORT_ENABLED | ||
+ | PAM_AUTH_LIB= -lpam | ||
+ | </ | ||
+ | |||
+ | To disable IPV6 support, for legacy device modify the makefile by disabling the IPV6_ENABLED define | ||
+ | From | ||
+ | < | ||
+ | ENABLE_IPV6_SUPPORT= | ||
+ | #TO ENABLE IPV6 support uncomment next line | ||
+ | ENABLE_IPV6_SUPPORT=-D IPV6_ENABLED | ||
+ | </ | ||
+ | |||
+ | to this | ||
+ | |||
+ | < | ||
+ | ENABLE_IPV6_SUPPORT= | ||
+ | #TO ENABLE IPV6 support uncomment next line | ||
+ | # | ||
+ | </ | ||
+ | openSSL libraries are required if uFTP is compiled with TLS support, under Ubuntu use the following command: | ||
+ | < | ||
+ | sudo apt-get install libssl-dev | ||
+ | </ | ||
+ | |||
+ | Generate a new certificate (only if TLS/SSH is enabled): | ||
+ | < | ||
+ | mkdir /etc/uFTP | ||
+ | |||
+ | cd /etc/uFTP | ||
+ | |||
+ | openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 | ||
+ | |||
+ | openssl rsa -in key.pem -out newkey.pem | ||
+ | |||
+ | mv newkey.pem key.pem | ||
+ | |||
+ | chown root:root / | ||
+ | |||
+ | chmod -rwx / | ||
+ | |||
+ | </ | ||
+ | |||
+ | Continue with the build. | ||
+ | |||
+ | < | ||
+ | # make | ||
+ | </ | ||
+ | |||
+ | Copy the files to the linux path, root permission are required under ubuntu use the sudo command. | ||
+ | < | ||
+ | # cp build/uFTP /sbin/uFTP | ||
+ | # cp uftpd.cfg / | ||
+ | </ | ||
+ | |||
+ | Set permissions and root restriction of the configuration file. | ||
+ | < | ||
+ | chown root:root /sbin/uFTP | ||
+ | chown root:root / | ||
+ | chmod -rwx / | ||
+ | </ | ||
+ | |||
+ | Run uFTP, note: root permissions are required to execute the uFTP server. | ||
+ | < | ||
+ | # uFTP | ||
+ | </ | ||
+ | |||
+ | |||
+ | **Option 2 install from binary** | ||
+ | |||
+ | Download the latest binary file for your OS: | ||
+ | |||
+ | < | ||
+ | # sudo cd /sbin | ||
+ | # for x64 | ||
+ | # sudo wget https:// | ||
+ | # for arm | ||
+ | # sudo wget https:// | ||
+ | </ | ||
+ | |||
+ | Download the latest configuration sample: | ||
+ | |||
+ | < | ||
+ | # sudo cd /etc | ||
+ | # sudo wget https:// | ||
+ | </ | ||
+ | |||
+ | Set permissions and root restriction of the configuration file. | ||
+ | < | ||
+ | chown root:root /sbin/uFTP | ||
+ | chown root:root / | ||
+ | chmod -rwx / | ||
+ | </ | ||
+ | |||
+ | Run uFTP, note: root permissions are required to execute the uFTP server. | ||
+ | < | ||
+ | # uFTP | ||
+ | </ | ||
+ | |||
+ | All binary downloads and examples can be found at: https:// | ||
+ | |||
+ | |||