<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pinetree</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pinetree"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Pinetree"/>
	<updated>2026-04-28T10:47:16Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=27510</id>
		<title>FTP</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=27510"/>
		<updated>2024-10-10T05:58:29Z</updated>

		<summary type="html">&lt;p&gt;Pinetree: Section rearrangements; minor cleanups and formatting changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;FTP (or &#039;&#039;&#039;F&#039;&#039;&#039;ile &#039;&#039;&#039;T&#039;&#039;&#039;ransfer &#039;&#039;&#039;P&#039;&#039;&#039;rotocol) is a protocol that allows you to transfer files from a server to a client and vice versa (as FTP uses a client-server architecture). FTP is among the oldest protocols as its origins can be traced as far back as 1971 according to [https://datatracker.ietf.org/doc/html/rfc114 RFC 114].&lt;br /&gt;
&lt;br /&gt;
Variants of FTP also exist, including SFTP (SSH FTP, not to be confused with Simple FTP) and FTPS (FTP with TLS). SFTP, as the name implies, is done over SSH. FTPS is plain FTP with TLS encryption.&lt;br /&gt;
&lt;br /&gt;
Alpine Linux has various FTP clients and servers that you can install and use, including the following:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|vsftpd|arch=}} (server)&lt;br /&gt;
* {{Pkg|ncftp|arch=}} (client)&lt;br /&gt;
&lt;br /&gt;
Plenty of other clients also exist, but the ones mentioned above are the only ones covered. See [[#Clients]] for more details.&lt;br /&gt;
&lt;br /&gt;
= Servers =&lt;br /&gt;
== vsftpd ==&lt;br /&gt;
&lt;br /&gt;
In Alpine Linux the default FTP server is {{Pkg|vsftpd|arch=}}. However, it&#039;s not widely used due to common hosting panels not handling it&#039;s configuration management. On the other hand, vsftpd is more secure and doesn&#039;t require many updates.&lt;br /&gt;
&lt;br /&gt;
vsftpd also claims it&#039;s the &amp;quot;most secure and fastest FTP server for UNIX-like systems&amp;quot;.  It&#039;s the default FTP server in NimbleX, Slackware, and many other Linux distributions. In addition, it&#039;s also recommended because of relatively easy configuration.&lt;br /&gt;
&lt;br /&gt;
Below is a list of features vsftpd has:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature                                 !! Value/Name                       !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file                      || {{Path|/etc/vsftpd/vsftpd.conf}} || The default config is stock from vsftpd&lt;br /&gt;
|-&lt;br /&gt;
| Default Path For Files                  || {{Path|/var/lib/ftp}}            || Because anonymous access is enabled by default, this is the daemon&#039;s default home directory&lt;br /&gt;
|-&lt;br /&gt;
| Log Files                               || {{Path|/var/log/vsftpd.log}}     || Configurable in vsftp.conf&lt;br /&gt;
|-&lt;br /&gt;
| User Running The Service                || vsftpd                           || Alpine does &#039;&#039;&#039;not&#039;&#039;&#039; have an {{ic|ftp}} user; it uses a group with the same name instead.&lt;br /&gt;
|-&lt;br /&gt;
| Group(s) to common to                   || vsftpd                           || Used to share things among others daemons or services, like Redis or Apache&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Limitations ====&lt;br /&gt;
&lt;br /&gt;
* SFTP is not supported&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
To install and run vsftpd, simply run {{ic|apk add vsftpd}}. Optionally install the {{Pkg|vsftpd-doc|arch=}} package alongside for documentation.&lt;br /&gt;
&lt;br /&gt;
To enable vsftpd on startup and start it now, run the following commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rc-update add vsftpd default&lt;br /&gt;
rc-service vsftpd start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
The default configuration is not ideal because anonymous access is enabled by default and only IPv4 support is enabled. Therefore, the default configuration should not be used in a production environment. Some common server configuration schemes include allowing anonymous access of files, user system FTP services, and virtual users (on the server end).&lt;br /&gt;
&lt;br /&gt;
Per-user FTP files can be supported by special directive in the vsftp.conf file using &amp;lt;code&amp;gt;user_sub_token&amp;lt;/code&amp;gt;. For example, this can be set to something like {{Path|/home/$USER/public_ftp}} if we enable it (process are described below in further section &amp;quot;vsftpd configuration&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
=== Managing vsftpd ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Starting vsftpd&#039;&#039;&#039;: After the installation {{Pkg|vsftpd}} is not running. As we said in first section, was started already but if you want to start vsftpd manually use:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd start}}&lt;br /&gt;
&lt;br /&gt;
If starting vsftpd went OK, you should see output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Caching service dependencies ...                           [ ok ]&lt;br /&gt;
 * Starting vsftpd...                                         [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Stopping vsftpd&#039;&#039;&#039;: if you want to stop the web server use &#039;&#039;stop&#039;&#039; in the same way of previous command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd stop}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restarting or reloading vsftpd&#039;&#039;&#039;: After changing the configuration file, you must either restart or reload vsftpd in order for the new configuration to take effect. You can run one of the following commands below to achieve the desired effect:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd restart}}&lt;br /&gt;
{{Cmd|rc-service vsftpd reload}}&lt;br /&gt;
&lt;br /&gt;
The latter reloads vsftpd&#039;s configuration file while the former restarts vsftpd entirely. The latter might be preferred as it prevents having to reload vsftpd entirely.&lt;br /&gt;
&lt;br /&gt;
If you &#039;&#039;restarted&#039;&#039; vsftpd, there should be output similar to the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Stopping vsftpd...                                         [ ok ]&lt;br /&gt;
 * Starting vsftpd...                                         [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you &#039;&#039;reloaded&#039;&#039; vsftpd, the output will be similar to the following instead:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Reloading vsftpd...                                        [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the proper runlevel&#039;&#039;&#039;: using the &amp;quot;default&amp;quot; runlevel should work in most cases, although there might be custom runlevels present and it might be more desirable to add vsftpd to a runlevel other than &amp;quot;default&amp;quot;. However, keep in mind that runlevels aren&#039;t present in Docker containers because Alpine is used mostly in Docker.&lt;br /&gt;
&lt;br /&gt;
To add vsftpd to a runlevel, use the following command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add vsftpd [runlevel]}}&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;code&amp;gt;[runlevel]&amp;lt;/code&amp;gt; is the name of the runlevel you want to add the vsftpd service too. For example, if you want to add vsftpd to the &amp;quot;default&amp;quot; run level, run &amp;lt;code&amp;gt;rc-update add vsftpd default&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Testing vsftpd ===&lt;br /&gt;
&lt;br /&gt;
This section is assuming that vsftpd is running. At the moment, there might not be the {{ic|ftp}} user allowed or even available, but the server is up and running.&lt;br /&gt;
&lt;br /&gt;
You can use {{pkg|netcat|arch=}} to test if a connection to the server is successful:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|nc -zv [server_address]}}&lt;br /&gt;
&lt;br /&gt;
Be sure to change {{ic|[server_address]}} with the actual IP address of the server. The common response will be &#039;&#039;&#039;OPEN&#039;&#039;&#039; if the server is running. If you receive another response, review your server configuration.&lt;br /&gt;
&lt;br /&gt;
= Clients =&lt;br /&gt;
&lt;br /&gt;
Because FTP uses a client-server architecture, you will need an FTP client if you want to interact with an FTP server. Alpine provides several packages for command-line FTP clients:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|lftp}}. See [[#lftp]] for more details.&lt;br /&gt;
* {{Pkg|ncftp}}&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical client, check out the following:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|pcmanfm}}. See [[#PCManFM with GVfs]]&lt;br /&gt;
&lt;br /&gt;
Some web browsers also support FTP, although most major brows, such as Chrome and Firefox, have removed support for the protocol.&lt;br /&gt;
&lt;br /&gt;
== lftp ==&lt;br /&gt;
&lt;br /&gt;
lftp is a sophisticated file transfer program that supports a number of network protocols, including FTP, HTTP, SFTP, FISH, and BitTorrent. It also has the following features:&lt;br /&gt;
&lt;br /&gt;
* Job control&lt;br /&gt;
* Support for bookmarks&lt;br /&gt;
* Support for a built-in mirror command&lt;br /&gt;
* Support for parallel file transfers&lt;br /&gt;
* Uses &amp;lt;code&amp;gt;readline&amp;lt;/code&amp;gt; for input&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature                                 !! Value/Name !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Package Name                            || lftp                                    || Install: {{ic|apk add lftp}}&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and &amp;lt;code&amp;gt;-doc&amp;lt;/code&amp;gt; Packages || vsftpd-doc                              || Install: {{ic|apk add {{pkg|lftp-doc|arch=}}}}&lt;br /&gt;
|-&lt;br /&gt;
| System Configuration Files              || {{Path|/etc/lftp.conf}}                 || Little to no customizations are made by Alpine&lt;br /&gt;
|-&lt;br /&gt;
| User Configuration Files                || {{Path|~/.lftprc}}, {{Path|~/.lftp/rc}} || The former is read first while the latter is read second if the former was not found.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
To install lftp, run {{ic|apk add lftp}}&lt;br /&gt;
&lt;br /&gt;
lftp has been provided in the main repository since Alpine 3.6, so it&#039;s a supported package that&#039;s ready for production use.&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
The main configuration file, {{path|/etc/lftp.conf}}, comes with different examples and comments. On startup, lftp reads {{path|/etc/lftp.conf}}, {{path|~/.lftprc}}, and {{path|~/.lftp/rc}} in that exact order. These files are used to set system-wide and user-specific settings.&lt;br /&gt;
&lt;br /&gt;
In the configuration file, use the command set followed by the name of the setting followed by its value. Use &amp;lt;code&amp;gt;on&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt; for boolean values. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set ftp:ssl-force on&lt;br /&gt;
set ssl:verify-certificate on&lt;br /&gt;
set ftp:use-feat off&lt;br /&gt;
set ftp:ssl-protect-data on&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specific settings can be set for specific servers only. Append a slash (/) in front of the server name for a specific server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set ftp:use-feat off /example.com&lt;br /&gt;
set ftp:ssl-force on /example.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The closure for {{ic|dns:}}, {{ic|net:}}, {{ic|ftp:}}, {{ic|http:}}, and {{ic|hftp:}} domain variables is currently just the host name as you specify it in the {{ic|open}} command (with some exceptions where closure is meaningless, e.g., {{ic|dns:cache-size}}). For some {{ic|cmd:}} domain variables the closure is the current URL without path. For other variables, it is currently not used. See examples in the sample {{ic|lftp.conf}}.}}&lt;br /&gt;
&lt;br /&gt;
=== More Info ===&lt;br /&gt;
&lt;br /&gt;
By default, lftp is not very verbose about operations it performs in the background. If you want more output, you can use the &#039;debug&#039; command (without the &#039;set&#039; command):&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;debug 5&amp;lt;/code&amp;gt; will display the full debug output.&lt;br /&gt;
* &amp;lt;code&amp;gt;debug 3&amp;lt;/code&amp;gt; will only display greeting messages and error messages.&lt;br /&gt;
&lt;br /&gt;
Note that using the -d switch from the command line will override any previous debug settings and the full debug output will be displayed.&lt;br /&gt;
&lt;br /&gt;
If you prefer some commands to be called by another name, you can set aliases using the &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; command. The syntax is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alias [name] [command]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[name]&amp;lt;/code&amp;gt; is the name of the lftpd alias and &amp;lt;code&amp;gt;[command]&amp;lt;/code&amp;gt; is the name of the lftpd command. A couple of examples are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alias dir ls&lt;br /&gt;
alias less more&lt;br /&gt;
alias zless zmore&lt;br /&gt;
alias bzless bzmore&lt;br /&gt;
alias reconnect &amp;quot;close; cache flush; cd .&amp;quot;&lt;br /&gt;
alias edit &amp;quot;eval -f &amp;quot;get $0 -o ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; shell \\&amp;quot;cp -p ~/.lftp/edit.tmp.$$ ~/.lftp/edit.tmp.$$.orig &amp;amp;&amp;amp; vim ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; test ~/.lftp/edit.tmp.$$ -nt ~/.lftp/edit.tmp.$$.orig\\&amp;quot; &amp;amp;&amp;amp; put ~/.lftp/edit.tmp.$$ -o $0; shell rm -f ~/.lftp/edit.tmp.$$*&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last alias should all be in one line. It gets a remote file, opens it with vim, and places the modified file back on the server. This can be very convenient when a file needs to be quickly edited and updated on the remote server.&lt;br /&gt;
&lt;br /&gt;
=== Example usage ===&lt;br /&gt;
&lt;br /&gt;
Below is an example of a mult-part download over SFTP:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lftp -e &#039;pget -c -n 5 /path/to/file&#039; &amp;lt;nowiki&amp;gt;sftp://username@server&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breakdown:&lt;br /&gt;
&lt;br /&gt;
* -e: execute a command&lt;br /&gt;
* pget: the command for partial download, in addition to its options:&lt;br /&gt;
** -c: option to resume&lt;br /&gt;
** -n: option for number of parts&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;sftp://username@server&amp;lt;/nowiki&amp;gt;: server URL&lt;br /&gt;
&lt;br /&gt;
== PCManFM with GVfs ==&lt;br /&gt;
&lt;br /&gt;
You can use the PCManFM file manager with the {{Pkg|gvfs}} plugin as a graphical FTP client. To connect to an FTP server, you can do the following:&lt;br /&gt;
&lt;br /&gt;
# From the menubar, go to Go &amp;gt; Connect to a server&lt;br /&gt;
# Choose the FTP protocol and input your username (path is optional)&lt;br /&gt;
# After a while you will input the password for the username you input&lt;br /&gt;
&lt;br /&gt;
[[File:Ftp-gui-pcmanfm_at_2020-09-11_14-13-03.png]]&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[PXE boot]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Newbie]]&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Web_Server]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pinetree</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Securing_Alpine_Linux&amp;diff=27509</id>
		<title>Securing Alpine Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Securing_Alpine_Linux&amp;diff=27509"/>
		<updated>2024-10-10T05:35:07Z</updated>

		<summary type="html">&lt;p&gt;Pinetree: Add headers to make navigation more friendly; minor (page source) formatting changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Securing Alpine Linux using Security Technical Implementation Guides (STIGs) involves several steps. STIGs are a series of security requirements and configurations that help to secure systems. While there might not be a specific STIG for Alpine Linux, you can follow general Linux hardening guidelines and apply the principles from other Linux STIGs. Here’s a step-by-step process:&lt;br /&gt;
&lt;br /&gt;
= Step 1: Update and Upgrade System =&lt;br /&gt;
&lt;br /&gt;
1. Update package lists:&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas apk update}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Upgrade installed packages:&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas apk upgrade}}&lt;br /&gt;
&lt;br /&gt;
= Step 2: Install Necessary Security Tools =&lt;br /&gt;
&lt;br /&gt;
1. Install the {{pkg|audit|arch=}} package:&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas apk add audit}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Install other necessary security packages:&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas apk add doas logrotate bash-completion openssh-server}}&lt;br /&gt;
&lt;br /&gt;
= Step 3: User and Access Management =&lt;br /&gt;
&lt;br /&gt;
1. Disable root login over SSH:&lt;br /&gt;
&lt;br /&gt;
Edit {{path|/etc/ssh/sshd_config}}:&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas vi /etc/ssh/sshd_config}}&lt;br /&gt;
&lt;br /&gt;
Set the following parameter:&lt;br /&gt;
&lt;br /&gt;
       PermitRootLogin no&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Ensure password complexity:&lt;br /&gt;
&lt;br /&gt;
Edit {{path|/etc/security/pwquality.conf}}:&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas vi /etc/security/pwquality.conf}}&lt;br /&gt;
&lt;br /&gt;
Add or update the following lines:&lt;br /&gt;
&lt;br /&gt;
   minlen = 14&lt;br /&gt;
   dcredit = -1&lt;br /&gt;
   ucredit = -1&lt;br /&gt;
   ocredit = -1&lt;br /&gt;
   lcredit = -1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Lock unused system accounts:&lt;br /&gt;
&lt;br /&gt;
   for user in `awk -F: &#039;($3 &amp;lt; 1000) {print $1}&#039; /etc/passwd`; do&lt;br /&gt;
       if [ $user !{{=}} &amp;quot;root&amp;quot; ]; then&lt;br /&gt;
           doas passwd -l $user&lt;br /&gt;
           doas chage -E 0 $user&lt;br /&gt;
       fi&lt;br /&gt;
   done&lt;br /&gt;
&lt;br /&gt;
= Step 4: File System and Directory Permissions =&lt;br /&gt;
&lt;br /&gt;
1. Set appropriate permissions on important directories:&lt;br /&gt;
&lt;br /&gt;
   doas chmod 700 /root&lt;br /&gt;
   doas chmod 600 /boot/grub/grub.cfg&lt;br /&gt;
   doas chmod 600 /etc/ssh/sshd_config&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Configure mount options:&lt;br /&gt;
&lt;br /&gt;
Edit {{path|/etc/fstab}}:&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas vi /etc/fstab}}&lt;br /&gt;
&lt;br /&gt;
Add `nosuid`, `nodev`, and `noexec` options to non-root partitions:&lt;br /&gt;
&lt;br /&gt;
   /dev/sda1 /home ext4 defaults,nosuid,nodev,noexec 0 2&lt;br /&gt;
&lt;br /&gt;
= Step 5: Network Security =&lt;br /&gt;
&lt;br /&gt;
1. Disable unnecessary services:&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas rc-update del &amp;lt;service_name&amp;gt;&lt;br /&gt;
   doas rc-service &amp;lt;service_name&amp;gt; stop}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Configure firewall (iptables):&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas apk add iptables&lt;br /&gt;
   doas rc-service iptables start&lt;br /&gt;
   doas rc-update add iptables}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Create a basic firewall ruleset:&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas vi /etc/iptables/rules.v4}}&lt;br /&gt;
&lt;br /&gt;
Example rules:&lt;br /&gt;
&lt;br /&gt;
   *filter&lt;br /&gt;
   :INPUT DROP [0:0]&lt;br /&gt;
   :FORWARD DROP [0:0]&lt;br /&gt;
   :OUTPUT ACCEPT [0:0]&lt;br /&gt;
   -A INPUT -i lo -j ACCEPT&lt;br /&gt;
   -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT&lt;br /&gt;
   -A INPUT -p tcp --dport 22 -j ACCEPT&lt;br /&gt;
   COMMIT&lt;br /&gt;
&lt;br /&gt;
= Step 6: Logging and Auditing =&lt;br /&gt;
&lt;br /&gt;
1. Configure system logging:&lt;br /&gt;
&lt;br /&gt;
Edit {{path|/etc/rsyslog.conf}} to ensure all log files are being captured:&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas vi /etc/rsyslog.conf}}&lt;br /&gt;
&lt;br /&gt;
Example configuration:&lt;br /&gt;
&lt;br /&gt;
   *.info;mail.none;authpriv.none;cron.none /var/log/messages&lt;br /&gt;
   authpriv.* /var/log/secure&lt;br /&gt;
   mail.* -/var/log/maillog&lt;br /&gt;
   cron.* /var/log/cron&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Set up audit rules:&lt;br /&gt;
&lt;br /&gt;
Edit {{path|/etc/audit/rules.d/audit.rules}}:&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas vi /etc/audit/rules.d/audit.rules}}&lt;br /&gt;
&lt;br /&gt;
Example rules:&lt;br /&gt;
&lt;br /&gt;
   -w /etc/passwd -p wa -k passwd_changes&lt;br /&gt;
   -w /etc/shadow -p wa -k shadow_changes&lt;br /&gt;
   -w /etc/group -p wa -k group_changes&lt;br /&gt;
&lt;br /&gt;
= Step 7: Apply Kernel and Service Hardening =&lt;br /&gt;
&lt;br /&gt;
1. Disable unused filesystems:&lt;br /&gt;
&lt;br /&gt;
Edit {{path|/etc/modprobe.d/disable-filesystems.conf}}:&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas vi /etc/modprobe.d/disable-filesystems.conf}}&lt;br /&gt;
&lt;br /&gt;
Add the following lines:&lt;br /&gt;
&lt;br /&gt;
   install cramfs /bin/true&lt;br /&gt;
   install freevxfs /bin/true&lt;br /&gt;
   install jffs2 /bin/true&lt;br /&gt;
   install hfs /bin/true&lt;br /&gt;
   install hfsplus /bin/true&lt;br /&gt;
   install squashfs /bin/true&lt;br /&gt;
   install udf /bin/true&lt;br /&gt;
   install vfat /bin/true&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Configure kernel parameters:&lt;br /&gt;
&lt;br /&gt;
Edit {{path|/etc/sysctl.conf}}:&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas vi /etc/sysctl.conf}}&lt;br /&gt;
&lt;br /&gt;
Add or update the following parameters:&lt;br /&gt;
&lt;br /&gt;
   net.ipv4.ip_forward = 0&lt;br /&gt;
   net.ipv4.conf.all.accept_source_route = 0&lt;br /&gt;
   net.ipv4.conf.all.accept_redirects = 0&lt;br /&gt;
   net.ipv4.conf.all.secure_redirects = 0&lt;br /&gt;
   net.ipv4.conf.all.log_martians = 1&lt;br /&gt;
   net.ipv4.conf.default.log_martians = 1&lt;br /&gt;
   net.ipv4.icmp_echo_ignore_broadcasts = 1&lt;br /&gt;
   net.ipv4.icmp_ignore_bogus_error_responses = 1&lt;br /&gt;
   net.ipv4.tcp_syncookies = 1&lt;br /&gt;
   net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
   net.ipv4.conf.default.send_redirects = 0&lt;br /&gt;
&lt;br /&gt;
= Step 8: Regular Maintenance =&lt;br /&gt;
&lt;br /&gt;
1. Set up regular updates:&lt;br /&gt;
&lt;br /&gt;
Create a cron job for regular updates:&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas crontab -e}}&lt;br /&gt;
&lt;br /&gt;
Add the following line to update daily at 2 AM:&lt;br /&gt;
&lt;br /&gt;
   0 2 * * * apk update &amp;amp;&amp;amp; apk upgrade&lt;br /&gt;
&lt;br /&gt;
2. Review and monitor logs regularly:&lt;br /&gt;
&lt;br /&gt;
Ensure logs are rotated and reviewed frequently:&lt;br /&gt;
&lt;br /&gt;
   {{cmd|doas logrotate /etc/logrotate.conf}}&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
This process provides a foundation for securing an Alpine Linux system. Regular reviews and updates, along with compliance with the latest security guidelines, are essential to maintaining a secure environment.&lt;/div&gt;</summary>
		<author><name>Pinetree</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Gaming_on_Alpine&amp;diff=22753</id>
		<title>Gaming on Alpine</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Gaming_on_Alpine&amp;diff=22753"/>
		<updated>2022-12-09T04:21:07Z</updated>

		<summary type="html">&lt;p&gt;Pinetree: Rewrite intro and installation sections, reorganize game list, update game info for some games, and rename last section to &amp;quot;See Also&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;It is possible to game on Alpine Linux.&lt;br /&gt;
&lt;br /&gt;
== Installing games ==&lt;br /&gt;
&lt;br /&gt;
Like with installing any other package, run the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apk add [game]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;code&amp;gt;[game]&amp;lt;/code&amp;gt; is the name of the package containing the game, like &amp;lt;code&amp;gt;micro-tetris&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Permissions ==&lt;br /&gt;
&lt;br /&gt;
To make sure your account is in the &amp;quot;games&amp;quot; group, run the following:&lt;br /&gt;
&lt;br /&gt;
 sudo gpasswd -a name games&lt;br /&gt;
&lt;br /&gt;
Log-off and then log back on in order for the changes to take effect. Most games don&#039;t require this in order to work.&lt;br /&gt;
&lt;br /&gt;
== List of games available on Alpine Linux ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.advancemame.it/ AdvanceMAME] (&amp;lt;code&amp;gt;advancemame&amp;lt;/code&amp;gt;) - Arcade simulator.&lt;br /&gt;
* [https://wiki.gnome.org/Apps/Aisleriot Aisleriot] (&amp;lt;code&amp;gt;aisleriot&amp;lt;/code&amp;gt;) - Solitaire card games.&lt;br /&gt;
* [https://www.dosbox.com/ DOSBox] (&amp;lt;code&amp;gt;dosbox&amp;lt;/code&amp;gt;) - DOS-emulator that uses SDL.&lt;br /&gt;
* [http://frotz.sourceforge.net/ Frotz] (&amp;lt;code&amp;gt;frotz&amp;lt;/code&amp;gt;) - Z machine (Infocom interactive fiction) Interpreter.&lt;br /&gt;
* [http://home.flightgear.org FlightGear] (&amp;lt;code&amp;gt;flightgear&amp;lt;/code&amp;gt;) - Flight simulator.&lt;br /&gt;
* [https://freedoom.github.io/ Freedoom]+[https://www.chocolate-doom.org/ Chocolate Doom] - (&amp;lt;code&amp;gt;freedoom&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;chocolate-doom&amp;lt;/code&amp;gt;) -- a free Doom game and an engine to run it.&lt;br /&gt;
* [https://en.wikipedia.org/wiki/GNU_Chess GNU Chess] (&amp;lt;code&amp;gt;gnuchess&amp;lt;/code&amp;gt;) - Play chess against the computer.&lt;br /&gt;
* [https://lgames.sourceforge.io/LBreakout2 LBreakout2] (&amp;lt;code&amp;gt;lbreakout2&amp;lt;/code&amp;gt;) - Ball-and-paddle game.&lt;br /&gt;
* [https://lgames.sourceforge.io/LBreakoutHD LBreakoutHD] (&amp;lt;code&amp;gt;lbreakouthd&amp;lt;/code&amp;gt;) - The successor to LBreakout2. Note: no level editor available. lbreakout2 is needed for level creation.&lt;br /&gt;
* [https://lgames.sourceforge.io/LPairs LPairs] (&amp;lt;code&amp;gt;lpairs&amp;lt;/code&amp;gt;) - Classical memory game.&lt;br /&gt;
* [https://github.com/troglobit/tetris Micro Tetris] (&amp;lt;code&amp;gt;micro-tetris&amp;lt;/code&amp;gt;) - A version of Tetris that uses ANSI escape sequences and can fit in embedded devices.&lt;br /&gt;
* [https://www.minetest.net/ Minetest] (&amp;lt;code&amp;gt;minetest&amp;lt;/code&amp;gt;) - An inspired Minecraft game.&lt;br /&gt;
* [https://openrct2.org/ OpenRCT2] - A free and open-source reimplementation of RollerCoaster Tycoon 2 but &#039;&#039;&#039;requires original RollerCoaster Tycoon 2 assets&#039;&#039;&#039;.&lt;br /&gt;
* [https://en.wikipedia.org/wiki/OpenTTD OpenTTD] (&amp;lt;code&amp;gt;openttd&amp;lt;/code&amp;gt;) - A business simulation game.&lt;br /&gt;
* [http://www.retroarch.com RetroArch] (&amp;lt;code&amp;gt;retroarch&amp;lt;/code&amp;gt;) - Frontend for emulators, game engines, and media players using libretro.&lt;br /&gt;
* [https://www.nethack.org NetHack] - Rogue-like dungeon crawler.&lt;br /&gt;
* [https://www.supertux.org/ SuperTux] (&amp;lt;code&amp;gt;supertux&amp;lt;/code&amp;gt;) - Classic 2D jump&#039;n&#039;run side-scroller game in a style similar to the original Super Mario games.&lt;br /&gt;
* [https://supertuxkart.net/Main_Page SuperTuxKart] - Kart racing game with OSS mascots.&lt;br /&gt;
* [http://www.xonotic.org/ Xonotic] (&amp;lt;code&amp;gt;xonotic&amp;lt;/code&amp;gt;) - A free and open-source FPS.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Steam]] - It is possible to install Steam on Alpine, but Valve only officially supports using Steam on Ubuntu.&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Wine_(software) Wine] (&amp;lt;code&amp;gt;wine&amp;lt;/code&amp;gt;) - Wine allows you to run some Windows software, including games, under Linux. A 32-bit Alpine chroot/multiboot might be required to use 32 bit Windows games under Wine.  If you use x86_64, you can only run 64 bit Windows programs.&lt;br /&gt;
* [https://obsproject.com/ OBS Studio] (&amp;lt;code&amp;gt;obs-studio&amp;lt;/code&amp;gt;) - Used by live streamers on streaming platforms such as YouTube and Twitch.&lt;/div&gt;</summary>
		<author><name>Pinetree</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=22752</id>
		<title>FTP</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=22752"/>
		<updated>2022-12-09T03:58:59Z</updated>

		<summary type="html">&lt;p&gt;Pinetree: Large cleanup: remove all red links, correct most (if not all) errors, remove page cleanup infobox&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;FTP (or &#039;&#039;&#039;F&#039;&#039;&#039;ile &#039;&#039;&#039;T&#039;&#039;&#039;ransfer &#039;&#039;&#039;P&#039;&#039;&#039;rotocol) is a protocol that allows you to transfer files from a server to a client and vice versa (as FTP uses a client-server architecture). FTP is among the oldest protocols as its origins can be traced as far back as 1971 according to [https://en.wikipedia.org/wiki/Ftp#History_of_FTP_servers Wikipedia].&lt;br /&gt;
&lt;br /&gt;
Variants of FTP also exist, including SFTP (SSH FTP, not to be confused with Simple FTP) and FTPS (FTP with SSL). SFTP, as the name implies, is done over SSH. FTPS is plain FTP with TLS/SSL encryption.&lt;br /&gt;
&lt;br /&gt;
Alpine Linux has various FTP clients and servers that you can install and use, including the following:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|vsftpd}} (server)&lt;br /&gt;
* {{Pkg|ncftp}} (client)&lt;br /&gt;
* {{Pkg|lftpd}} (client)&lt;br /&gt;
&lt;br /&gt;
Plenty of other clients also exist, but the ones mentioned above are the only ones covered. See [[#Clients]] for more details.&lt;br /&gt;
&lt;br /&gt;
= Servers =&lt;br /&gt;
== vsftpd ==&lt;br /&gt;
&lt;br /&gt;
In Alpine Linux the default FTP server is {{Pkg|vsftpd}}. However, it&#039;s not widely used due to common hosting panels not handling it&#039;s configuration management. In contrast, {{Pkg|vsftpd}} is more secure and doesn&#039;t require many updates.&lt;br /&gt;
&lt;br /&gt;
vsftpd also claims it&#039;s the &amp;quot;most secure and fastest FTP server for UNIX-like systems&amp;quot;.  It&#039;s the default FTP server in NimbleX, Slackware, and many other Linux distributions. In addition, it&#039;s also recommended because of relatively easy configuration.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature                                 !! Value/Name                       !! Observations&lt;br /&gt;
|-&lt;br /&gt;
| Package name                            || vsftpd                           || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and &amp;lt;code&amp;gt;-doc&amp;lt;/code&amp;gt; packages || vsftpd-doc                       || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file                      || {{Path|/etc/vsftpd/vsftpd.conf}} || The default config is stock from vsftpd&lt;br /&gt;
|-&lt;br /&gt;
| Default Path For Files                  || {{Path|/var/lib/ftp}}            || Because anonymous access is enabled by default, this is the daemon&#039;s default home directory&lt;br /&gt;
|-&lt;br /&gt;
| Log Files                               || {{Path|/var/log/vsftpd.log}}     || Configurable in vsftp.conf&lt;br /&gt;
|-&lt;br /&gt;
| User Running The Service                || vsftpd                           || Alpine does &#039;&#039;&#039;not&#039;&#039;&#039; have an &amp;quot;ftp&amp;quot; user; it uses a group with the same name instead.&lt;br /&gt;
|-&lt;br /&gt;
| Group(s) to common to                   || vsftpd                           || Used to share things among others daemons or services, like Redis or Apache&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Limitations ====&lt;br /&gt;
&lt;br /&gt;
* SFTP is not supported&lt;br /&gt;
&lt;br /&gt;
=== Installing vsftpd ===&lt;br /&gt;
&lt;br /&gt;
To install and run vsftpd, simply run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apk add vsftpd&lt;br /&gt;
&lt;br /&gt;
rc-update add vsftpd default&lt;br /&gt;
&lt;br /&gt;
rc-service vsftpd restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring vsftpd ===&lt;br /&gt;
&lt;br /&gt;
The default configuration is not ideal because anonymous access is enabled by default and IPv4 support is only enabled. Therefore, the default configuration should not be considered suitable for production uses. Some common server configuration schemes include allowing anonymous access of files, user system FTP services, and virtual users (on the server end).&lt;br /&gt;
&lt;br /&gt;
Per user FTP files can be supported by special directive in the vsftp.conf file using &amp;lt;code&amp;gt;user_sub_token&amp;lt;/code&amp;gt;. For example, this can be set to something like {{Path|/home/$USER/public_ftp}} if we enable it (process are described below in further section &amp;quot;vsftpd configuration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Managing vsftpd ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Starting vsftpd&#039;&#039;&#039;: After the installation {{Pkg|vsftpd}} is not running. As we said in first section, was started already but if you want to start {{Pkg|vsftpd}} manually use:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd start}}&lt;br /&gt;
&lt;br /&gt;
If starting vsftpd went OK, you should see output similar to the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Caching service dependencies ...                           [ ok ]&lt;br /&gt;
 * Starting vsftpd...                                         [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Stopping vsftpd&#039;&#039;&#039;: if you want to stop the web server use &#039;&#039;stop&#039;&#039; in the same way of previous command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd stop}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restarting or reloading vsftpd&#039;&#039;&#039;: After changing the configuration file, you must either restart or reload vsftpd in order for the new configuration to take effect. You can run one of the following commands below to achieve the desired effect:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd restart}}&lt;br /&gt;
{{Cmd|rc-service vsftpd reload}}&lt;br /&gt;
&lt;br /&gt;
The latter reloads vsftpd&#039;s configuration file while the former restarts vsftpd entirely. The latter might be preferred as it prevents having to reload vsftpd entirely.&lt;br /&gt;
&lt;br /&gt;
If you &#039;&#039;restarted&#039;&#039; vsftpd, there should be output similar to the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Stopping vsftpd...                                         [ ok ]&lt;br /&gt;
 * Starting vsftpd...                                         [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you &#039;&#039;reloaded&#039;&#039; vsftpd, the output will be similar to the following instead:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Reloading vsftpd...                                        [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the proper runlevel&#039;&#039;&#039;: using the &amp;quot;default&amp;quot; runlevel should work in most cases, although there might be custom runlevels present and it might be more desirable to add vsftpd to a runlevel other than &amp;quot;default&amp;quot;. However, keep in mind that runlevels aren&#039;t present in Docker containers because Alpine is used mostly in Docker.&lt;br /&gt;
&lt;br /&gt;
To add vsftpd to a runlevel, use the following command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add vsftpd [runlevel]}}&lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;code&amp;gt;[runlevel]&amp;lt;/code&amp;gt; is the name of the runlevel you want to add the vsftpd service too. For example, if you want to add vsftpd to the &amp;quot;default&amp;quot; run level, run &amp;lt;code&amp;gt;rc-update add vsftpd default&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Testing vsftpd ===&lt;br /&gt;
&lt;br /&gt;
This section is assuming that vsftpd is running. At the moment, there might not be the &#039;ftp&#039; user allowed or even available, but the server is up and running.&lt;br /&gt;
&lt;br /&gt;
You can use netcat to test if a connection to the server is successful:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|nc -zv server_address}}&lt;br /&gt;
&lt;br /&gt;
Be sure to change &amp;lt;code&amp;gt;server_address&amp;lt;/code&amp;gt; with the actual IP address of the server. The common response will be &#039;&#039;&#039;OPEN&#039;&#039;&#039; if the server is running. If you receive another response, review your server configuration.&lt;br /&gt;
&lt;br /&gt;
= Clients =&lt;br /&gt;
&lt;br /&gt;
Because FTP uses a client-server architecture, you will need an FTP client if you want to interact with an FTP server. Alpine provides several packages for command-line FTP clients:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|lftp}}. Check out [[#lftp]]&lt;br /&gt;
* {{Pkg|ncftp}}&lt;br /&gt;
&lt;br /&gt;
If you prefer a graphical client, check out the following:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|pcmanfm}}. See PCManFM with GVfs]]&lt;br /&gt;
&lt;br /&gt;
Some web browsers also support FTP, although most major such as Chrome and Firefox removed support.&lt;br /&gt;
&lt;br /&gt;
== lftp ==&lt;br /&gt;
&lt;br /&gt;
lftp is a sophisticated file transfer program that supports a number of network protocols, including FTP, HTTP, SFTP, FISH, and BitTorrent. It also has the following features:&lt;br /&gt;
&lt;br /&gt;
* Job control&lt;br /&gt;
* Support for bookmarks&lt;br /&gt;
* Support for a built-in mirror command&lt;br /&gt;
* Support for parallel file transfers&lt;br /&gt;
* &amp;lt;code&amp;gt;readline&amp;lt;/code&amp;gt; used for input&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature                                 !! Value/Name !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Package Name                            || lftp                                    || Install: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and &amp;lt;code&amp;gt;-doc&amp;lt;/code&amp;gt; Packages || vsftpd-doc                              || Install: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| System Configuration Files              || {{Path|/etc/lftp.conf}}                 || Little to no customizations are made by Alpine&lt;br /&gt;
|-&lt;br /&gt;
| User Configuration Files                || {{Path|~/.lftprc}}, {{Path|~/.lftp/rc}} || The former is read first while the latter is read second if the former was not found.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing lftp ===&lt;br /&gt;
&lt;br /&gt;
To install lftp, run &amp;lt;pre&amp;gt;apk add lftp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lftp has been provided in the main repository since Alpine 3.6, so it&#039;s a supported package that&#039;s ready for production use.&lt;br /&gt;
&lt;br /&gt;
=== Configuring lftp ===&lt;br /&gt;
&lt;br /&gt;
The main configuration file, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;/etc/lftp.conf&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; comes with different examples and comments. On startup, lftp reads &amp;lt;code&amp;gt;/etc/lftp.conf&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;~/.lftprc&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;~/.lftp/rc&amp;lt;/code&amp;gt; in that exact order. These files are used to set system-wide and user-specific settings.&lt;br /&gt;
&lt;br /&gt;
In the configuration file, use the command set followed by the name of the setting followed by its value. Use &amp;lt;code&amp;gt;on&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;off&amp;lt;/code&amp;gt; for boolean values. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set ftp:ssl-force on&lt;br /&gt;
set ssl:verify-certificate on&lt;br /&gt;
set ftp:use-feat off&lt;br /&gt;
set ftp:ssl-protect-data on&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specific settings can be set for specific servers only. Append a slash (/) in front of the server name for a specific server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:use-feat off /example.com&lt;br /&gt;
set ftp:ssl-force on /example.com&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The closure for `dns:&#039;, `net:&#039;, `ftp:&#039;, `http:&#039;, `hftp:&#039; domain variables is currently just the host name as you specify it in the `open&#039; command (with some exceptions where closure is meaningless, e.g., dns:cache-size). For some `cmd:&#039; domain variables the closure is the current URL without path. For other variables, it is currently not used. See examples in the sample lftp.conf.}}&lt;br /&gt;
&lt;br /&gt;
=== More on lftp ===&lt;br /&gt;
&lt;br /&gt;
By default, lftp is not very verbose about operations it performs in the background. If you want more output, you can use the &#039;debug&#039; command (without the &#039;set&#039; command):&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;debug 5&amp;lt;/code&amp;gt; will display the full debug output.&lt;br /&gt;
* &amp;lt;code&amp;gt;debug 3&amp;lt;/code&amp;gt; will only display greeting messages and error messages.&lt;br /&gt;
&lt;br /&gt;
Note that using the -d switch from the command line will override any previous debug settings and the full debug output will be displayed.&lt;br /&gt;
&lt;br /&gt;
If you prefer some commands to be called by another name, you can set aliases:&lt;br /&gt;
&lt;br /&gt;
lftpd supports aliases in the format &amp;lt;code&amp;gt;alias [name] [command]&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;[name]&amp;lt;/code&amp;gt; is the name of the lftpd alias and &amp;lt;code&amp;gt;[command]&amp;lt;/code&amp;gt; is the name of the lftpd command. A couple of examples are shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alias dir ls&lt;br /&gt;
alias less more&lt;br /&gt;
alias zless zmore&lt;br /&gt;
alias bzless bzmore&lt;br /&gt;
alias reconnect &amp;quot;close; cache flush; cd .&amp;quot;&lt;br /&gt;
alias edit &amp;quot;eval -f &amp;quot;get $0 -o ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; shell \\&amp;quot;cp -p ~/.lftp/edit.tmp.$$ ~/.lftp/edit.tmp.$$.orig &amp;amp;&amp;amp; vim ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; test ~/.lftp/edit.tmp.$$ -nt ~/.lftp/edit.tmp.$$.orig\\&amp;quot; &amp;amp;&amp;amp; put ~/.lftp/edit.tmp.$$ -o $0; shell rm -f ~/.lftp/edit.tmp.$$*&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last alias should all be in one line. It gets a remote file, opens it with vim, and places the modified file back on the server. This can be very convenient when a file needs to be quickly edited and updated on the remote server.&lt;br /&gt;
&lt;br /&gt;
=== Example usage ===&lt;br /&gt;
&lt;br /&gt;
Below is an example of a mult-part download over SFTP:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lftp -e &#039;pget -c -n 5 /path/to/file&#039; &amp;lt;nowiki&amp;gt;sftp://username@server&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breakdown:&lt;br /&gt;
&lt;br /&gt;
* -e: execute a command&lt;br /&gt;
* pget: the command for partial download, in addition to its options:&lt;br /&gt;
** -c: option to resume&lt;br /&gt;
** -n: option for number of parts&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;sftp://username@server&amp;lt;/nowiki&amp;gt;: server URL&lt;br /&gt;
&lt;br /&gt;
== PCManFM with GVfs ==&lt;br /&gt;
&lt;br /&gt;
While PCManFM is a file manager, installing the {{Pkg|gvfs}} plugin allows you to use it as a graphical FTP client. To connect to an FTP server, you can do the following:&lt;br /&gt;
&lt;br /&gt;
# From the menubar, go to Go &amp;gt; Connect to a server&lt;br /&gt;
# Choose the FTP protocol and input your username (path is optional)&lt;br /&gt;
# After a while you will input the password for the username you input&lt;br /&gt;
&lt;br /&gt;
[[File:Ftp-gui-pcmanfm_at_2020-09-11_14-13-03.png]]&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[PXE boot]]&lt;br /&gt;
* [[Alpine newbie]]&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Newbie]]&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Web_Server]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pinetree</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=19325</id>
		<title>FTP</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=19325"/>
		<updated>2021-05-13T02:20:27Z</updated>

		<summary type="html">&lt;p&gt;Pinetree: More grammar corrections, typo fixes, rearrangements, enhancements, and a bit of restructuring. Added new banner to notify that content should be restructured&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Style|This page has been rampant with typos and grammar errors before,  most of which have been corrected. However, this page could probably be restructured so that the content flows more smoothly, although this is currently being worked on.}}&lt;br /&gt;
&lt;br /&gt;
FTP (or &#039;&#039;&#039;F&#039;&#039;&#039;ile &#039;&#039;&#039;T&#039;&#039;&#039;ransfer &#039;&#039;&#039;P&#039;&#039;&#039;rotocol) is a protocol that allows you to transfer files from a server to a client and vice versa (as FTP uses a client-server architecture). FTP is among the oldest protocols as its origins can be traced as far back as 1971 according to [https://en.wikipedia.org/wiki/Ftp#History_of_FTP_servers Wikipedia].&lt;br /&gt;
&lt;br /&gt;
There are also variants of FTP. Such include SFTP (SSH FTP, not to be confused with Simple FTP), FTPS (FTP SSL), and others. SFTP, as the name implies, is done over SSH. FTPS is plain FTP with TLS/SSL encryption.&lt;br /&gt;
&lt;br /&gt;
Alpine Linux has various FTP clients and servers that you can install and use:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|vsftpd}} (server)&lt;br /&gt;
* {{Pkg|ncftp}} (client)&lt;br /&gt;
* {{Pkg|lftpd}} (client, but see below for more details).&lt;br /&gt;
&lt;br /&gt;
There are also plenty of other clients available too, some not available in Alpine&#039;s repositories in fact. However, we will only be covering the clients and servers mentioned above. In addition, there are several graphical clients. See [[#FTP Clients]] for more details.&lt;br /&gt;
&lt;br /&gt;
= Servers = &lt;br /&gt;
== vsftpd ==&lt;br /&gt;
&lt;br /&gt;
In Alpine Linux the default FTP server is {{Pkg|vsftpd}}. However, it&#039;s not widely used due to common hosting panels not handling it&#039;s configuration management. In contrast {{Pkg|vsftpd}} is more secure and doesn&#039;t require many updates.&lt;br /&gt;
&lt;br /&gt;
== About vsftpd ==&lt;br /&gt;
&lt;br /&gt;
vsftpd claims to be the &amp;quot;most secure and fastest FTP server for UNIX-like systems&amp;quot;.  It&#039;s the default FTP server in NimbleX, Slackware, and many others. In addition, it&#039;s also recommended because of relatively easy configuration.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature !! Value/Name !! Observations&lt;br /&gt;
|-&lt;br /&gt;
| Package name || vsftpd || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file || {{Path|/etc/vsftpd/vsftpd.conf}} || Little to no customizations are made by Alpine&lt;br /&gt;
|-&lt;br /&gt;
| Default path for files || {{Path|/var/lib/ftp}} || cos anonymous are default, is home for daemon user&lt;br /&gt;
|-&lt;br /&gt;
| Log files (error, access, etc) || {{Path|/var/log/vsftpd.log}} || Defined in vsftp.conf&lt;br /&gt;
|-&lt;br /&gt;
| User running the service || vsftpd || Others Linux used &amp;quot;ftp&amp;quot; alpine has as a group&lt;br /&gt;
|-&lt;br /&gt;
| Group to common to || vsftpd || Used to share things among others daemons or services, like Redis or Apache&lt;br /&gt;
|-&lt;br /&gt;
| Written in || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Limitations ====&lt;br /&gt;
&lt;br /&gt;
* vsftp does not support SFTP, but it does have support for FTPS.&lt;br /&gt;
&lt;br /&gt;
=== Installing vsftpd ===&lt;br /&gt;
&lt;br /&gt;
The installation does not work out of the box, cos enable by default anonymous access is enabled and it only works with IPv4 only.&lt;br /&gt;
&lt;br /&gt;
Per user ftp files can be supported by special directive in the vsftp.conf file using &amp;lt;code&amp;gt;user_sub_token&amp;lt;/code&amp;gt; to something like {{Path|/home/$USER/public_ftp}} directory by example if we enable it (process are described below in further section &amp;quot;vsftpd configuration&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|vsftpd}} is available in the Alpine Linux repositories. To install and run vsftpd, simply run the commands below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add vsftpd&lt;br /&gt;
&lt;br /&gt;
rc-update add vsftpd default&lt;br /&gt;
&lt;br /&gt;
rc-service vsftpd restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring vsftpd ===&lt;br /&gt;
&lt;br /&gt;
By default, Alpine&#039;s vsftpd package does not modify the default configuration. If you leave the configuration untouched, then vsftpd will be configured exactly the same as if you downloaded vsftpd from [[https://security.appspot.com/vsftpd.html its site]]. Regardless, you might want to change the server configuration anyways.&lt;br /&gt;
&lt;br /&gt;
The server configuration obviously depends on the your needs. Some common server configuration schemes include allowing anonymous access of files, user system FTP services, and virtual users (on the server end). &lt;br /&gt;
&lt;br /&gt;
For production purposes, the [[Production FTP virtual users: vsftpd + MySQL]] wiki page will explain all the requirements for setting up virtual users. The [[Production FTP user service: vsftpd]] wiki page also has further information on how to use vsftpd with system users and Let&#039;s Encrypt certificates [&#039;&#039;&#039;fixme&#039;&#039;&#039;: pages doesn&#039;t exist].&lt;br /&gt;
&lt;br /&gt;
Because there are no customizations to the default configuration (in other words no Alpine-specific customizations), the configuration may not mean easy maintenance of the server, among other things. See the [[Production VSFTP system: vsftpd + MySQL + SFTP]] wiki page, which goes in depth about configuring the lighttpd web server and others [&#039;&#039;&#039;fixme&#039;&#039;&#039;: page does not exist].&lt;br /&gt;
&lt;br /&gt;
==== Controlling vsftpd ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Starting vsftpd&#039;&#039;&#039;&#039;&#039;: After the installation {{Pkg|vsftpd}} is not running. As we said in first section, was started already but if you want to start {{Pkg|vsftpd}} manually use:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd start}}&lt;br /&gt;
&lt;br /&gt;
After you issue this command, OpenRC will tell you the status of vsftpd.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Caching service dependencies ...                           [ ok ]&lt;br /&gt;
 * Starting vsftpd...                                         [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Stopping vsftpd&#039;&#039;&#039;: If you want to stop the web server use &#039;&#039;stop&#039;&#039; in the same way of previous command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd stop}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Restarting or reloading vsftpd&#039;&#039;&#039;: After changing the configuration file, you must either restart or reload vsftpd in order for the new configuration to take effect. You can issue one of the following commands below to achieve the desired effect:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd restart}}&lt;br /&gt;
{{Cmd|rc-service vsftpd reload}}&lt;br /&gt;
&lt;br /&gt;
The latter command entirely restarts vsftpd, while the former only reloads vsftpd&#039;s configuration file. The former command might be more desired as it prevents having to reload vsftpd entirely.&lt;br /&gt;
&lt;br /&gt;
After issuing one of the commands, you might see something similar either to this output:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Stopping vsftpd...                                         [ ok ]&lt;br /&gt;
 * Starting vsftpd...                                         [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(for restarting vsftpd) or to this output:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Reloading vsftpd...                                        [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(for reloading vsftpd).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the proper runlevel&#039;&#039;&#039;: By default no services are added to start process. You must know what you want and what will these services do. Furthermore, runlevels aren&#039;t present in Docker containers (per se), and Alpine is used mostly in those containers. You must add the service only to the &#039;default&#039; runlevel, not to the &#039;boot&#039; runlevel. Networking isn&#039;t enabled during the the &#039;boot&#039; runlevel, and thus it doesn&#039;t make much sense to run an FTP server without networking.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add vsftpd default}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Testing vsftpd ===&lt;br /&gt;
&lt;br /&gt;
This section is assuming that vsftpd is running. At the moment, there might not be a user &#039;ftp&#039; allowed available but the server is up and running.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|nc -zv server_address}}&lt;br /&gt;
&lt;br /&gt;
Be sure to change &amp;lt;code&amp;gt;server_address&amp;lt;/code&amp;gt; with the actual IP address of the server. The common response will be &#039;&#039;&#039;OPEN&#039;&#039;&#039; if the server is running.&lt;br /&gt;
&lt;br /&gt;
=== See also about vsftpd ===&lt;br /&gt;
&lt;br /&gt;
* [[Production Lets Encrypt: dehydrated]]&lt;br /&gt;
* [[Production FTP user service: vsftpd]]&lt;br /&gt;
* [[Production FTP virtual users: vsftpd + MySQL]]&lt;br /&gt;
* [[Production VSFTP system: vsftpd + MySQL + SFTP]]&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
&lt;br /&gt;
= FTP Clients =&lt;br /&gt;
&lt;br /&gt;
As FTP uses a client-server architecture, you will need an FTP client if you want to interact with an FTP server. Alpine provides two packages for command line and batch processing of files over FTP. The following is a list of some graphical FTP clients:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|pcmanfm}}. Check out [[#PCManFM with GVfs]]&lt;br /&gt;
* {{Pkg|firefox}}, before [https://www.mozilla.org/en-US/firefox/88.0/releasenotes/ Firefox 88], or any other web browser supporting FTP.&lt;br /&gt;
&lt;br /&gt;
The following is a list of some command line FTP clients:&lt;br /&gt;
* {{Pkg|lftp}}. Check out [[#lftp]]&lt;br /&gt;
* {{Pkg|ncftp}}&lt;br /&gt;
&lt;br /&gt;
You can also use any web browser that supports FTP as an FTP client also, as is obvious. To do so, simply enter &amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;ftp://server_address&amp;lt;/code&amp;gt;&amp;lt;/nowiki&amp;gt;, where &amp;quot;server_address&amp;quot; is the IP address of the FTP server.&lt;br /&gt;
&lt;br /&gt;
== lftp ==&lt;br /&gt;
&lt;br /&gt;
LFTP is a sophisticated file transfer program that supports a number of network protocols. Such include FTP, HTTP, SFTP, FISH, BitTorrent, and possibly more.&lt;br /&gt;
&lt;br /&gt;
lftp has the following features:&lt;br /&gt;
&lt;br /&gt;
* lftp supports job control&lt;br /&gt;
* The readline library is used for input&lt;br /&gt;
* lftp has support for bookmarks&lt;br /&gt;
* lftp has a built-in mirror command&lt;br /&gt;
* lftp can transfer several files in parallel&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature !! Value/Name !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Main package name || lftp || Install: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || Install: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (system) || {{Path|/etc/lftp.conf}} || Little to no customizations are made by Alpine&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftprc}} || The first user configuration file to read from.&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftp/rc}} || Second user configuration file to read from.&lt;br /&gt;
|-&lt;br /&gt;
| Written in || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing lftp ===&lt;br /&gt;
&lt;br /&gt;
To install lftp, run the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add lftp&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lftp has been provided in the main repository since Alpine 3.6, so it&#039;s a supported package that&#039;s ready for production use.&lt;br /&gt;
&lt;br /&gt;
=== Configuring lftp ===&lt;br /&gt;
&lt;br /&gt;
The main configuration file, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;/etc/lftp.conf&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; comes with different examples and comments. On startup, lftp reads &amp;lt;code&amp;gt;/etc/lftp.conf&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;~/.lftprc&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;~/.lftp/rc&amp;lt;/code&amp;gt; (in the specified order). You can use those files to set system-wide and user-specific settings.&lt;br /&gt;
&lt;br /&gt;
In your configuration file, simply use the command set followed by the name of the setting, followed by its value. Use on/off for boolean values. Here&#039;s an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:ssl-force on&lt;br /&gt;
set ssl:verify-certificate on&lt;br /&gt;
set ftp:use-feat off&lt;br /&gt;
set ftp:ssl-protect-data on&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can set specific settings for specific servers only. Simply append a slash (/) and the server name to the setting.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:use-feat off /example.com&lt;br /&gt;
set ftp:ssl-force on /example.com&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The closure for `dns:&#039;, `net:&#039;, `ftp:&#039;, `http:&#039;, `hftp:&#039; domain variables is currently just the host name as you specify it in the `open&#039; command (with some exceptions where closure is meaningless, e.g. dns:cache-size). For some `cmd:&#039; domain variables the closure is the current URL without path. For other variables it is not currently used. See examples in the sample lftp.conf.}}&lt;br /&gt;
&lt;br /&gt;
=== More on lftp ===&lt;br /&gt;
&lt;br /&gt;
By default, lftp is not very verbose about operations it performs in the background. If you want more output, e.g. for debugging purposes, you can use the &#039;debug&#039; command (without the &#039;set&#039; command):&lt;br /&gt;
&lt;br /&gt;
* debug 5 will display the full debug output.&lt;br /&gt;
* debug 3 will only display greeting messages and error messages.&lt;br /&gt;
&lt;br /&gt;
Note that if you use the -d switch from the command line, the debug setting will be overruled and the full debug output will be displayed.&lt;br /&gt;
&lt;br /&gt;
If you prefer some commands to be called by another name, you can set aliases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alias dir ls&lt;br /&gt;
alias less more&lt;br /&gt;
alias zless zmore&lt;br /&gt;
alias bzless bzmore&lt;br /&gt;
alias reconnect &amp;quot;close; cache flush; cd .&amp;quot;&lt;br /&gt;
alias edit &amp;quot;eval -f &amp;quot;get $0 -o ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; shell \\&amp;quot;cp -p ~/.lftp/edit.tmp.$$ ~/.lftp/edit.tmp.$$.orig &amp;amp;&amp;amp; vim ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; test ~/.lftp/edit.tmp.$$ -nt ~/.lftp/edit.tmp.$$.orig\\&amp;quot; &amp;amp;&amp;amp; put ~/.lftp/edit.tmp.$$ -o $0; shell rm -f ~/.lftp/edit.tmp.$$*&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last alias (edit) should be all in one line. It allows you to get a remote file, edit it with vim (change as needed), and place the edited file back on the server. This is very convenient!&lt;br /&gt;
&lt;br /&gt;
=== Example usage ===&lt;br /&gt;
&lt;br /&gt;
Below is an example of a mult-part download over the SFTP protocol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$ lftp -e &#039;pget -c -n 5 /path/to/file&#039; &amp;lt;nowiki&amp;gt;sftp://username@server&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a breakdown of the above command:&lt;br /&gt;
&lt;br /&gt;
* -e: lftp option to execute command&lt;br /&gt;
* pget: is the command for partial download&lt;br /&gt;
* -c: pget option to resume&lt;br /&gt;
* -n: pget option for number of parts&lt;br /&gt;
&lt;br /&gt;
== PCManFM with GVfs ==&lt;br /&gt;
&lt;br /&gt;
While PCManFM is a file manager, installing the {{Pkg|gvfs}} plugin allows you to use it as a graphical FTP client. To connect to an FTP server, you can do the following:&lt;br /&gt;
&lt;br /&gt;
# From the menubar open the &amp;quot;go&amp;quot; menu&lt;br /&gt;
# Choose &amp;quot;Connect to a server&amp;quot;&lt;br /&gt;
# Choose the FTP protocol and input your username (path is optional)&lt;br /&gt;
# After a while you will input the password for the username you input&lt;br /&gt;
&lt;br /&gt;
Check the picture for further reference.&lt;br /&gt;
&lt;br /&gt;
[[File:Ftp-gui-pcmanfm_at_2020-09-11_14-13-03.png]]&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
* https://pkgs.alpinelinux.org/packages?name=tftp-hpa related to [[PXE boot]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Newbie]]&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Web_Server]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
ddd&lt;/div&gt;</summary>
		<author><name>Pinetree</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Pinetree&amp;diff=19322</id>
		<title>User:Pinetree</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Pinetree&amp;diff=19322"/>
		<updated>2021-05-12T20:57:22Z</updated>

		<summary type="html">&lt;p&gt;Pinetree: added a little thing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hello there! I&#039;m just a simple pine tree that&#039;s willing to look for pages to clean up. If you have any pages that I could try to clean up, feel free to edit the [[User_talk:Pinetree|Discussion]] page. If you want me to contribute technical knowledge as apart of a page clean, then I might be able to, though no guarantees are being made.&lt;/div&gt;</summary>
		<author><name>Pinetree</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User_talk:Pinetree&amp;diff=19321</id>
		<title>User talk:Pinetree</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User_talk:Pinetree&amp;diff=19321"/>
		<updated>2021-05-12T20:50:29Z</updated>

		<summary type="html">&lt;p&gt;Pinetree: Created my user discussion page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Articles to Edit =&lt;br /&gt;
List here for any articles that I could attempt to clean up. For example&lt;br /&gt;
&lt;br /&gt;
* Link to sample page.&lt;br /&gt;
&lt;br /&gt;
Of course links are not mandatory.&lt;/div&gt;</summary>
		<author><name>Pinetree</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:Pinetree&amp;diff=19320</id>
		<title>User:Pinetree</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:Pinetree&amp;diff=19320"/>
		<updated>2021-05-12T20:49:15Z</updated>

		<summary type="html">&lt;p&gt;Pinetree: Added my user page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hello there! I&#039;m just a simple pine tree that&#039;s willing to look for pages to clean up. If you have any pages that I could try to clean up, feel free to edit the [[User_talk:Pinetree|Discussion]] page.&lt;/div&gt;</summary>
		<author><name>Pinetree</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=19319</id>
		<title>FTP</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=19319"/>
		<updated>2021-05-12T20:14:35Z</updated>

		<summary type="html">&lt;p&gt;Pinetree: Minor changes, fixed typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;FTP (or &#039;&#039;&#039;F&#039;&#039;&#039;ile &#039;&#039;&#039;T&#039;&#039;&#039;ransfer &#039;&#039;&#039;P&#039;&#039;&#039;rotocol) is a protocol that allows you to transfer files from a server to a client and vice versa (as FTP uses a client-server architecture). FTP is among the oldest protocols as its origins can be traced as far back as 1971 (more on [https://en.wikipedia.org/wiki/Ftp#History_of_FTP_servers Wikipedia]).&lt;br /&gt;
&lt;br /&gt;
There are also varients of FTP. Such include SFTP (SSH FTP, not to be confused with Simple FTP), FTPS (FTP SSL), and others. SFTP, as the name implies, is done over SSH. FTPS is plain FTP with TLS/SSL encryption.&lt;br /&gt;
&lt;br /&gt;
Alpine Linux has various FTP clients and servers that you can install and use:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|vsftpd}} (server)&lt;br /&gt;
* {{Pkg|ncftp}} (client)&lt;br /&gt;
* {{Pkg|lftpd}} (client, but see below for more details).&lt;br /&gt;
&lt;br /&gt;
There are also plenty of other clients available too, some not available in Alpine&#039;s repositories in fact. However, we will only be covering the clients and servers mentioned above. In addition, there are several graphical clients. See [[#FTP Clients]] for more details.&lt;br /&gt;
&lt;br /&gt;
= FTP Server: vsftpd =&lt;br /&gt;
&lt;br /&gt;
In Alpine Linux the default FTP server is {{Pkg|vsftpd}}. However, it is not very used due common hosting panels does not handle it&#039;s configurations management. In contrast {{Pkg|vsftpd}} are secured respect rest of others without so much updates.&lt;br /&gt;
&lt;br /&gt;
=== FTP server: About vsftpd package ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;It was the most secured FTP server&#039;&#039;&#039;.  It is the default FTP server in NimbleX, Slackware, and many others.&lt;br /&gt;
&lt;br /&gt;
{{Note|As for minimal FTP&#039;s and fast server purposes are very recommended due it easy configuration process and perfect performance without much configuration.}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature !! Value/Name !! Observations&lt;br /&gt;
|-&lt;br /&gt;
| Package name || vsftpd || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file || {{Path|/etc/vsftpd/vsftpd.conf}} || It&#039;s not close to alpine, just vanilla provived!&lt;br /&gt;
|-&lt;br /&gt;
| Default path for files || {{Path|/var/lib/ftp}} || cos anonnimous are default, is home for daemon user&lt;br /&gt;
|-&lt;br /&gt;
| Log files (error, access, etc) || {{Path|/var/log/vsftpd.log}} || Defined in vsftp.conf also&lt;br /&gt;
|-&lt;br /&gt;
| User running the service || vsftpd || Others Linux used &amp;quot;ftp&amp;quot; alpine has as a group&lt;br /&gt;
|-&lt;br /&gt;
| Group to common to || vsftpd || Used to share things among others daemons or services, like Redis or Apache files&lt;br /&gt;
|-&lt;br /&gt;
| Written in || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Important Limitations ====&lt;br /&gt;
&lt;br /&gt;
vsftp does not support SFTP, but it does have support for FTPS.&lt;br /&gt;
&lt;br /&gt;
=== Install vsftpd ===&lt;br /&gt;
&lt;br /&gt;
The installation does not work out of the box, cos enable by default anonymous access is enabled and it only works with IPv4 only.&lt;br /&gt;
&lt;br /&gt;
Per user ftp files can be supported by special directive in the vsftp.conf file using &amp;lt;code&amp;gt;user_sub_token&amp;lt;/code&amp;gt; to something like {{Path|/home/$USER/public_ftp}} directory by example if we enable it (process are described below in further section &amp;quot;vsftpd configuration&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|vsftpd}} is available in the Alpine Linux repositories. To install and run vsftpd, simply run the commands below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add vsftpd&lt;br /&gt;
&lt;br /&gt;
rc-update add vsftpd default&lt;br /&gt;
&lt;br /&gt;
rc-service vsftpd restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== vsftpd Configuration ===&lt;br /&gt;
&lt;br /&gt;
By default, Alpine&#039;s vsftpd package does not provide any special configuration, just vanilla provided so we must specify what we want!&lt;br /&gt;
&lt;br /&gt;
Configurations depends of the purpose of the FTP nature to serve, the most common cases are anonymously ftp service, user system ftp service and virtual users ftp service.. &lt;br /&gt;
&lt;br /&gt;
For production purposes the [[Production FTP virtual users: vsftpd + MySQL]] wiki page will explain in details all the needs for a virtual users case, there&#039;s the [[Production FTP user service: vsftpd]] wiki page with futher information to use with system users and lets encrypt certificates.&lt;br /&gt;
&lt;br /&gt;
Due to the minimalism of alpine linux, &#039;&#039;&#039;unfortunately the vsftpd packaging only provided vanilla configurations not close to alpine or easy admin maintenance&#039;&#039;&#039;, see the [[Production VSFTP system: vsftpd + MySQL + SFTP]] wiki page to goin in deep about configuring lighttpd web server.&lt;br /&gt;
&lt;br /&gt;
==== Controlling vsftpd ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Start vsftpd&#039;&#039;&#039;&#039;&#039;: After the installation {{Pkg|vsftpd}} is not running. As we said in first section, was started already but if you want to start {{Pkg|vsftpd}} manually use:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd start}}&lt;br /&gt;
&lt;br /&gt;
You will get a feedback about the status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Caching service dependencies ...                           [ ok ]&lt;br /&gt;
 * Starting vsftpd...                                         [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Stop vsftpd&#039;&#039;&#039;&#039;&#039;: If you want to stop the web server use &#039;&#039;stop&#039;&#039; in the same way of previous command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd stop}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Restart lighttpd&#039;&#039;&#039;&#039;&#039;: After changing the configuration file lighttpd needs to be restarted.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd restart}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Proper Runlevel&#039;&#039;&#039;&#039;&#039;: By default no services are added to start process, sysadmin must know what we want and what will services do, also other main reason are due in dockers there&#039;s no runlevels per se and Alpine linux are mostly used in dockers containers. You must added the servide only to the default runlevel, not to boot, because need networking activated&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add vsftpd default}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Testing vsftpd ===&lt;br /&gt;
&lt;br /&gt;
This section is assuming that vsftpd is running. Well, at the moment there is no user ftp allowed available but the server is up and running.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|nc -zv server_address}}&lt;br /&gt;
&lt;br /&gt;
Be sure to change &amp;lt;code&amp;gt;server_address&amp;lt;/code&amp;gt; with the actual IP address of the server. The common response will be &#039;&#039;&#039;OPEN&#039;&#039;&#039; if the server is running.&lt;br /&gt;
&lt;br /&gt;
=== See also about vsftpd ===&lt;br /&gt;
&lt;br /&gt;
* [[Production Lets Encrypt: dehydrated]]&lt;br /&gt;
* [[Production FTP user service: vsftpd]]&lt;br /&gt;
* [[Production FTP virtual users: vsftpd + MySQL]]&lt;br /&gt;
* [[Production VSFTP system: vsftpd + MySQL + SFTP]]&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
&lt;br /&gt;
= FTP Clients =&lt;br /&gt;
&lt;br /&gt;
As FTP uses a client-server architecture, you will need an FTP client if you want to interact with an FTP server. Alpine Linux provides two packages for command line and batch processing of FTP protocol, apart of the {{Pkg|firefox}} package: the {{Pkg|lftp}} and the {{Pkg|ncftp}} packages.&lt;br /&gt;
&lt;br /&gt;
* GUI programs:&lt;br /&gt;
** {{Pkg|pcmanfm}}. Check out [[#PCManFM with GVfs]]&lt;br /&gt;
** {{Pkg|firefox}}, before [https://www.mozilla.org/en-US/firefox/88.0/releasenotes/ Firefox 88]&lt;br /&gt;
* CLI programs:&lt;br /&gt;
** {{Pkg|lftp}}. Check out [[#lftp]]&lt;br /&gt;
** {{Pkg|ncftp}}&lt;br /&gt;
&lt;br /&gt;
You can also use any web browser that supports FTP as an FTP client also, as is obvious. To do so, simply enter &amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;ftp://server_address&amp;lt;/code&amp;gt;&amp;lt;/nowiki&amp;gt;, where &amp;quot;server_address&amp;quot; is the IP address of the FTP server.&lt;br /&gt;
&lt;br /&gt;
== lftp ==&lt;br /&gt;
&lt;br /&gt;
LFTP is a sophisticated file transfer program that supports a number of network protocols. Such include FTP, HTTP, SFTP, FISH, and BitTorrent (and potentially more). &lt;br /&gt;
&lt;br /&gt;
lftp has the following features:&lt;br /&gt;
&lt;br /&gt;
* Has job control and..&lt;br /&gt;
* uses the readline library for input. &lt;br /&gt;
* It has bookmarks, &lt;br /&gt;
* Has built-in mirror command&lt;br /&gt;
* Can transfer several files in parallel.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature !! Value/Name !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Main package name || lftp || Install: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || Install: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (system) || {{Path|/etc/lftp.conf}} || This is just a default configuration file (no Alpine customizations).&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftprc}} || The first user configuration file to read from.&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftp/rc}} || Second user configuration file to read from (if there&#039;s a problem with the first one).&lt;br /&gt;
|-&lt;br /&gt;
| Written in || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing lftp ===&lt;br /&gt;
&lt;br /&gt;
To install lftp, run the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add lftp&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lftp has been provided in the main repository since Alpine 3.6, so it&#039;s a supported package that&#039;s ready for production use.&lt;br /&gt;
&lt;br /&gt;
=== Configuring lftp ===&lt;br /&gt;
&lt;br /&gt;
The main configuration file, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;/etc/lftp.conf&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; comes with various examples and comments. On startup, lftp reads &amp;lt;code&amp;gt;/etc/lftp.conf&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;~/.lftprc&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;~/.lftp/rc&amp;lt;/code&amp;gt; (in the specified order). You can use those files to set system-wide and user-specific settings.&lt;br /&gt;
&lt;br /&gt;
In your configuration file, simply use the command set followed by the name of the setting, followed by its value. Use on/off for boolean values. Check this example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:ssl-force on&lt;br /&gt;
set ssl:verify-certificate on&lt;br /&gt;
set ftp:use-feat off&lt;br /&gt;
set ftp:ssl-protect-data on&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can set specific settings for specific servers only. Simply append a slash (/) and the server name to the setting.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:use-feat off /example.com&lt;br /&gt;
set ftp:ssl-force on /example.com&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The closure for `dns:&#039;, `net:&#039;, `ftp:&#039;, `http:&#039;, `hftp:&#039; domain variables is currently just the host name as you specify it in the `open&#039; command (with some exceptions where closure is meaningless, e.g. dns:cache-size). For some `cmd:&#039; domain variables the closure is current URL without path. For other variables it is not currently used. See examples in the sample lftp.conf.}}&lt;br /&gt;
&lt;br /&gt;
=== General lftp usage examples ===&lt;br /&gt;
&lt;br /&gt;
By default, lftp is silent about the operations it performs in the background. If you need some more output, e.g. for debugging purposes, you can use the &#039;debug&#039; command (without the &#039;set&#039; command):&lt;br /&gt;
&lt;br /&gt;
* debug 5 will display the full debug output.&lt;br /&gt;
* debug 3 will only display greeting messages and error messages.&lt;br /&gt;
&lt;br /&gt;
Note that if you use the -d switch from the command line, the debug setting will be overruled and the full debug output will be displayed.&lt;br /&gt;
&lt;br /&gt;
If you prefer some commands to be called by another name, you can set aliases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alias dir ls&lt;br /&gt;
alias less more&lt;br /&gt;
alias zless zmore&lt;br /&gt;
alias bzless bzmore&lt;br /&gt;
alias reconnect &amp;quot;close; cache flush; cd .&amp;quot;&lt;br /&gt;
alias edit &amp;quot;eval -f &amp;quot;get $0 -o ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; shell \\&amp;quot;cp -p ~/.lftp/edit.tmp.$$ ~/.lftp/edit.tmp.$$.orig &amp;amp;&amp;amp; vim ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; test ~/.lftp/edit.tmp.$$ -nt ~/.lftp/edit.tmp.$$.orig\\&amp;quot; &amp;amp;&amp;amp; put ~/.lftp/edit.tmp.$$ -o $0; shell rm -f ~/.lftp/edit.tmp.$$*&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last alias (edit) should be all in one line. It allows you to get a remote file, edit it with vim (change as needed), and place the edited file back on the server. This is very convenient!&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Example usage&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a mult-part download over the SFTP protocol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;$ lftp -e &#039;pget -c -n 5 /path/to/file&#039; sftp://username@server&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a breakdown of the above command:&lt;br /&gt;
&lt;br /&gt;
* -e: lftp option to execute command&lt;br /&gt;
* pget: is the command for partial download&lt;br /&gt;
* -c: pget option to resume&lt;br /&gt;
* -n: pget option for number of parts&lt;br /&gt;
&lt;br /&gt;
== PCManFM with GVfs ==&lt;br /&gt;
&lt;br /&gt;
While PCManFM is a file manager, installing the {{Pkg|gvfs}} plugin allows you to use it as a graphical FTP client. To connect to an FTP server, you can do the following:&lt;br /&gt;
&lt;br /&gt;
# From the menubar open the &amp;quot;go&amp;quot; menu&lt;br /&gt;
# Choose &amp;quot;Connect to a server&amp;quot;&lt;br /&gt;
# Choose the FTP protocol and input username (path is optional)&lt;br /&gt;
# After a while you will input the password&lt;br /&gt;
&lt;br /&gt;
Check the picture for further reference:&lt;br /&gt;
&lt;br /&gt;
[[File:Ftp-gui-pcmanfm_at_2020-09-11_14-13-03.png]]&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
* https://pkgs.alpinelinux.org/packages?name=tftp-hpa related to [[PXE boot]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Newbie]]&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Web_Server]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pinetree</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=18871</id>
		<title>FTP</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=18871"/>
		<updated>2021-04-25T16:55:54Z</updated>

		<summary type="html">&lt;p&gt;Pinetree: Edited firefox ftp support&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;FTP (or &#039;&#039;&#039;F&#039;&#039;&#039;ile &#039;&#039;&#039;T&#039;&#039;&#039;ransfer &#039;&#039;&#039;P&#039;&#039;&#039;rotocol) is a protocol that allows you to transfer files from a server to a client and vice versa (as FTP uses a client-server architecture). FTP is among the oldest protocols as its origins can be traced as far back as 1971 (more on [https://en.wikipedia.org/wiki/Ftp#History_of_FTP_servers Wikipedia]).&lt;br /&gt;
&lt;br /&gt;
There are also varients of FTP. Such include SFTP (SSH FTP, not to be confused with Simple FTP), FTPS (FTP SSL), and others. SFTP, as the name implies, is done over SSH. FTPS is plain FTP with TLS/SSL encryption.&lt;br /&gt;
&lt;br /&gt;
Alpine Linux has various FTP clients and servers that you can install and use:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|vsftpd}} (server)&lt;br /&gt;
* {{Pkg|ncftp}} (client)&lt;br /&gt;
* {{Pkg|lftpd}} (client, but see below for more details).&lt;br /&gt;
* You can also use {{Pkg|pcmanfm}} with the {{Pkg|gvfs}} plugin as a graphical FTP client.&lt;br /&gt;
&lt;br /&gt;
There are also plenty of other clients available too. However, we will only be covering the clients and servers mentioned above. &lt;br /&gt;
&lt;br /&gt;
= FTP Server: vsftpd =&lt;br /&gt;
&lt;br /&gt;
In Alpine Linux the default FTP server is {{Pkg|vsftpd}}. However, it is not very used due common hosting panels does not handle it&#039;s configurations management. In constrast {{Pkg|vsftpd}} are secured respect rest of others without so much updates.&lt;br /&gt;
&lt;br /&gt;
=== FTP server: About vsftpd package ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;It was the most secured FTP server&#039;&#039;&#039;.  It is the default FTP server in NimbleX, Slackware, and many others.&lt;br /&gt;
&lt;br /&gt;
{{Note|As for minimal FTP&#039;s and fast server purposes are very recommended due it easy configuration process and perfect performance without much configuration.}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature !! Value/Name !! Observations&lt;br /&gt;
|-&lt;br /&gt;
| Package name || vsftpd || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file || {{Path|/etc/vsftpd/vsftpd.conf}} || It&#039;s not close to alpine, just vanilla provived!&lt;br /&gt;
|-&lt;br /&gt;
| Default path for files || {{Path|/var/lib/ftp}} || cos anonnimous are default, is home for daemon user&lt;br /&gt;
|-&lt;br /&gt;
| Log files (error, access, etc) || {{Path|/var/log/vsftpd.log}} || Defined in vsftp.conf also&lt;br /&gt;
|-&lt;br /&gt;
| User running the service || vsftpd || Others Linux used &amp;quot;ftp&amp;quot; alpine has as a group&lt;br /&gt;
|-&lt;br /&gt;
| Group to common to || vsftpd || Used to share things among others daemons or services, like Redis or Apache files&lt;br /&gt;
|-&lt;br /&gt;
| Written in || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Important Limitations ====&lt;br /&gt;
&lt;br /&gt;
vsftp does not support SFTP, but it does have support for FTPS.&lt;br /&gt;
&lt;br /&gt;
=== Install vsftpd ===&lt;br /&gt;
&lt;br /&gt;
The installation does not work out of the box, cos enable by default anonymous access is enabled and it only works with IPv4 only.&lt;br /&gt;
&lt;br /&gt;
Per user ftp files can be supported by special directive in the vsftp.conf file using &amp;lt;code&amp;gt;user_sub_token&amp;lt;/code&amp;gt; to something like {{Path|/home/$USER/public_ftp}} directory by example if we enable it (process are described below in further section &amp;quot;vsftpd configuration&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|vsftpd}} is available in the Alpine Linux repositories. To install and run vsftpd, simply run the commands below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add vsftpd&lt;br /&gt;
&lt;br /&gt;
rc-update add vsftpd default&lt;br /&gt;
&lt;br /&gt;
rc-service vsftpd restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== vsftpd Configuration ===&lt;br /&gt;
&lt;br /&gt;
By default, Alpine&#039;s vsftpd package does not provide any special configuration, just vanilla provided so we must specify what we want!&lt;br /&gt;
&lt;br /&gt;
Configurations depends of the purpose of the FTP nature to serve, the most common cases are anonymously ftp service, user system ftp service and virtual users ftp service.. &lt;br /&gt;
&lt;br /&gt;
For production purposes the [[Production FTP virtual users: vsftpd + MySQL]] wiki page will explain in details all the needs for a virtual users case, there&#039;s the [[Production FTP user service: vsftpd]] wiki page with futher information to use with system users and lets encrypt certificates.&lt;br /&gt;
&lt;br /&gt;
Due to the minimalism of alpine linux, &#039;&#039;&#039;unfortunately the vsftpd packaging only provided vanilla configurations not close to alpine or easy admin maintenance&#039;&#039;&#039;, see the [[Production VSFTP system: vsftpd + MySQL + SFTP]] wiki page to goin in deep about configuring lighttpd web server.&lt;br /&gt;
&lt;br /&gt;
==== Controlling vsftpd ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Start vsftpd&#039;&#039;&#039;&#039;&#039;: After the installation {{Pkg|vsftpd}} is not running. As we said in first section, was started already but if you want to start {{Pkg|vsftpd}} manually use:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd start}}&lt;br /&gt;
&lt;br /&gt;
You will get a feedback about the status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Caching service dependencies ...                           [ ok ]&lt;br /&gt;
 * Starting vsftpd...                                         [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Stop vsftpd&#039;&#039;&#039;&#039;&#039;: If you want to stop the web server use &#039;&#039;stop&#039;&#039; in the same way of previous command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd stop}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Restart lighttpd&#039;&#039;&#039;&#039;&#039;: After changing the configuration file lighttpd needs to be restarted.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd restart}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Proper Runlevel&#039;&#039;&#039;&#039;&#039;: By default no services are added to start process, sysadmin must know what we want and what will services do, also other main reason are due in dockers there&#039;s no runlevels per se and Alpine linux are mostly used in dockers containers. You must added the servide only to the default runlevel, not to boot, because need networking activated&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add vsftpd default}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Testing vsftpd ===&lt;br /&gt;
&lt;br /&gt;
This section is assuming that vsftpd is running. Well, at the moment there is no user ftp allowed available but the server is up and running.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|nc -zv 127.0.0.1 21}}&lt;br /&gt;
&lt;br /&gt;
Note that we used &amp;quot;127.0.0.1&amp;quot; if you are using alpine as the only machine for all as your main desktop/pc/machine.&lt;br /&gt;
&lt;br /&gt;
If you are using alpine remotely as web server and just install it the package, change &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;127.0.0.1&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; with IP of the alpine machine. The &amp;quot;webserveripaddres&amp;quot; are the IP address of your setup/server machine.&lt;br /&gt;
&lt;br /&gt;
The common response will be &#039;&#039;&#039;OPEN&#039;&#039;&#039; if server are running.&lt;br /&gt;
&lt;br /&gt;
=== See also about vsftpd ===&lt;br /&gt;
&lt;br /&gt;
* [[Production Lets Encrypt: dehydrated]]&lt;br /&gt;
* [[Production FTP user service: vsftpd]]&lt;br /&gt;
* [[Production FTP virtual users: vsftpd + MySQL]]&lt;br /&gt;
* [[Production VSFTP system: vsftpd + MySQL + SFTP]]&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
&lt;br /&gt;
= FTP clients =&lt;br /&gt;
&lt;br /&gt;
As FTP uses a client-server architecture, you will need an FTP client if you want to interact with an FTP server. Alpine Linux provides two packages for command line and batch processing of FTP protocol, apart of the {{Pkg|firefox}} package: the {{Pkg|lftp}} and the {{Pkg|ncftp}} packages.&lt;br /&gt;
&lt;br /&gt;
* GUI programs:&lt;br /&gt;
** {{Pkg|pcmanfm}}. Check out [[#PCManFM with GVfs]]&lt;br /&gt;
** {{Pkg|firefox}} [https://www.mozilla.org/en-US/firefox/88.0/releasenotes/ before Firefox 88]&lt;br /&gt;
* CLI programs:&lt;br /&gt;
** {{Pkg|lftp}}. Check out [[#lftp]]&lt;br /&gt;
** {{Pkg|ncftp}}&lt;br /&gt;
&lt;br /&gt;
So then, &#039;&#039;&#039;commonly a web browser (firefox) supports FTP protocol&#039;&#039;&#039; so our FTP server just configured can be &#039;&#039;&#039;browsed using the address &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ftp://&amp;lt;webserveripaddres&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; The &amp;quot;webserveripaddres&amp;quot; are the ip address of your setup/server machine.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== lftp ==&lt;br /&gt;
&lt;br /&gt;
LFTP is a sophisticated file transfer program that supports a number of network protocols. Such include FTP, HTTP, SFTP, FISH, and BitTorrent (and potentially more). &lt;br /&gt;
&lt;br /&gt;
lftp has the following features:&lt;br /&gt;
&lt;br /&gt;
* Has job control and..&lt;br /&gt;
* uses the readline library for input. &lt;br /&gt;
* It has bookmarks, &lt;br /&gt;
* Has built-in mirror command&lt;br /&gt;
* Can transfer several files in parallel.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature !! Value/Name !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Main package name || lftp || Install: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || Install: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (system) || {{Path|/etc/lftp.conf}} || This is just a default configuration file (no Alpine customizations).&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftprc}} || The first user configuration file to read from.&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftp/rc}} || Second user configuration file to read from (if there&#039;s a problem with the first one).&lt;br /&gt;
|-&lt;br /&gt;
| Written in || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing lftp ===&lt;br /&gt;
&lt;br /&gt;
To install lftp, run the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add lftp&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lftp has been provided in the main repository since Alpine 3.6, so it&#039;s a supported package that&#039;s ready for production use.&lt;br /&gt;
&lt;br /&gt;
=== Configuring lftp ===&lt;br /&gt;
&lt;br /&gt;
The main configuration file, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;/etc/lftp.conf&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; comes with various examples and comments. On startup, lftp reads &amp;lt;code&amp;gt;/etc/lftp.conf&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;~/.lftprc&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;~/.lftp/rc&amp;lt;/code&amp;gt; (in the specified order). You can use those files to set system-wide and user-specific settings.&lt;br /&gt;
&lt;br /&gt;
In your configuration file, simply use the command set followed by the name of the setting, followed by its value. Use on/off for boolean values. Check this example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:ssl-force on&lt;br /&gt;
set ssl:verify-certificate on&lt;br /&gt;
set ftp:use-feat off&lt;br /&gt;
set ftp:ssl-protect-data on&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can set specific settings for specific servers only. Simply append a slash (/) and the server name to the setting.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:use-feat off /example.com&lt;br /&gt;
set ftp:ssl-force on /example.com&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The closure for `dns:&#039;, `net:&#039;, `ftp:&#039;, `http:&#039;, `hftp:&#039; domain variables is currently just the host name as you specify it in the `open&#039; command (with some exceptions where closure is meaningless, e.g. dns:cache-size). For some `cmd:&#039; domain variables the closure is current URL without path. For other variables it is not currently used. See examples in the sample lftp.conf.}}&lt;br /&gt;
&lt;br /&gt;
=== General lftp usage examples ===&lt;br /&gt;
&lt;br /&gt;
By default, lftp is silent about the operations it performs in the background. If you need some more output, e.g. for debugging purposes, you can use the &#039;debug&#039; command (without the &#039;set&#039; command):&lt;br /&gt;
&lt;br /&gt;
* debug 5 will display the full debug output.&lt;br /&gt;
* debug 3 will only display greeting messages and error messages.&lt;br /&gt;
&lt;br /&gt;
Note that if you use the -d switch from the command line, the debug setting will be overruled and the full debug output will be displayed.&lt;br /&gt;
&lt;br /&gt;
If you prefer some commands to be called by another name, you can set aliases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alias dir ls&lt;br /&gt;
alias less more&lt;br /&gt;
alias zless zmore&lt;br /&gt;
alias bzless bzmore&lt;br /&gt;
alias reconnect &amp;quot;close; cache flush; cd .&amp;quot;&lt;br /&gt;
alias edit &amp;quot;eval -f &amp;quot;get $0 -o ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; shell \\&amp;quot;cp -p ~/.lftp/edit.tmp.$$ ~/.lftp/edit.tmp.$$.orig &amp;amp;&amp;amp; vim ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; test ~/.lftp/edit.tmp.$$ -nt ~/.lftp/edit.tmp.$$.orig\\&amp;quot; &amp;amp;&amp;amp; put ~/.lftp/edit.tmp.$$ -o $0; shell rm -f ~/.lftp/edit.tmp.$$*&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last alias (edit) should be all in one line. It allows you to get a remote file, edit it with vim (change as needed), and place the edited file back on the server. This is very convenient!&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Example usage&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a mult-part download over the SFTP protocol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;$ lftp -e &#039;pget -c -n 5 /path/to/file&#039; sftp://username@server&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
short explanation:&lt;br /&gt;
&lt;br /&gt;
* -e: lftp option to execute command&lt;br /&gt;
* pget: is the command for partial download&lt;br /&gt;
* -c: pget option to resume&lt;br /&gt;
* -n: pget option for number of parts&lt;br /&gt;
&lt;br /&gt;
== PCManFM with GVfs ==&lt;br /&gt;
&lt;br /&gt;
While PCManFM is a filemanager, by using the {{Pkg|gvfs}} plugin, we can use PCManFM as a graphical FTP client. To use PCManFM as an FTP client, you can do the following:&lt;br /&gt;
&lt;br /&gt;
# From the menubar open the &amp;quot;go&amp;quot; menu&lt;br /&gt;
# Choose &amp;quot;Connect to a server&amp;quot;&lt;br /&gt;
# Choose the FTP protocol and input username (path is optional)&lt;br /&gt;
# After a while you will input the password&lt;br /&gt;
&lt;br /&gt;
Check the picture for further reference:&lt;br /&gt;
&lt;br /&gt;
[[File:Ftp-gui-pcmanfm_at_2020-09-11_14-13-03.png]]&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
* https://pkgs.alpinelinux.org/packages?name=tftp-hpa related to [[PXE boot]]&lt;br /&gt;
link&lt;br /&gt;
[[Category:Newbie]]&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Web_Server]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pinetree</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=18648</id>
		<title>FTP</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=18648"/>
		<updated>2021-02-11T16:52:23Z</updated>

		<summary type="html">&lt;p&gt;Pinetree: More fixes and improvements, corrected wrong package name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;FTP (or &#039;&#039;&#039;F&#039;&#039;&#039;ile &#039;&#039;&#039;T&#039;&#039;&#039;ransfer &#039;&#039;&#039;P&#039;&#039;&#039;rotocol) is a protocol that allows you to transfer files from a server to a client and vice versa (as FTP uses a client-server architecture). FTP is among the oldest protocols as its origins can be traced as far back as 1971 (more on [https://en.wikipedia.org/wiki/Ftp#History_of_FTP_servers Wikipedia]).&lt;br /&gt;
&lt;br /&gt;
There are also varients of FTP. Such include SFTP (SSH FTP, not to be confused with Simple FTP), FTPS (FTP SSL), and others. SFTP, as the name implies, is done over SSH. FTPS is plain FTP with TLS/SSL encryption.&lt;br /&gt;
&lt;br /&gt;
Alpine Linux has various FTP clients and servers that you can install and use:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|vsftpd}} (server)&lt;br /&gt;
* {{Pkg|ncftp}} (client)&lt;br /&gt;
* {{Pkg|lftpd}} (client, but see below for more details).&lt;br /&gt;
* You can also use {{Pkg|pcmanfm}} with the {{Pkg|gvfs}} plugin as a graphical FTP client.&lt;br /&gt;
&lt;br /&gt;
There are also plenty of other clients available too. However, we will only be covering the clients and servers mentioned above. &lt;br /&gt;
&lt;br /&gt;
= FTP Server: vsftpd =&lt;br /&gt;
&lt;br /&gt;
In Alpine Linux the default FTP server is {{Pkg|vsftpd}}. However, it is not very used due common hosting panels does not handle it&#039;s configurations management. In constrast {{Pkg|vsftpd}} are secured respect rest of others without so much updates.&lt;br /&gt;
&lt;br /&gt;
=== FTP server: About vsftpd package ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;It was the most secured FTP server&#039;&#039;&#039;.  It is the default FTP server in NimbleX, Slackware, and many others.&lt;br /&gt;
&lt;br /&gt;
{{Note|As for minimal FTP&#039;s and fast server purposes are very recommended due it easy configuration process and perfect performance without much configuration.}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature !! Value/Name !! Observations&lt;br /&gt;
|-&lt;br /&gt;
| Package name || vsftpd || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file || {{Path|/etc/vsftpd/vsftpd.conf}} || It&#039;s not close to alpine, just vanilla provived!&lt;br /&gt;
|-&lt;br /&gt;
| Default path for files || {{Path|/var/lib/ftp}} || cos anonnimous are default, is home for daemon user&lt;br /&gt;
|-&lt;br /&gt;
| Log files (error, access, etc) || {{Path|/var/log/vsftpd.log}} || Defined in vsftp.conf also&lt;br /&gt;
|-&lt;br /&gt;
| User running the service || vsftpd || Others Linux used &amp;quot;ftp&amp;quot; alpine has as a group&lt;br /&gt;
|-&lt;br /&gt;
| Group to common to || vsftpd || Used to share things among others daemons or services, like Redis or Apache files&lt;br /&gt;
|-&lt;br /&gt;
| Written in || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Important Limitations ====&lt;br /&gt;
&lt;br /&gt;
vsftp does not support SFTP, but it does have support for FTPS.&lt;br /&gt;
&lt;br /&gt;
=== Install vsftpd ===&lt;br /&gt;
&lt;br /&gt;
The installation does not work out of the box, cos enable by default anonymous access is enabled and it only works with IPv4 only.&lt;br /&gt;
&lt;br /&gt;
Per user ftp files can be supported by special directive in the vsftp.conf file using &amp;lt;code&amp;gt;user_sub_token&amp;lt;/code&amp;gt; to something like {{Path|/home/$USER/public_ftp}} directory by example if we enable it (process are described below in further section &amp;quot;vsftpd configuration&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|vsftpd}} is available in the Alpine Linux repositories. To install and run vsftpd, simply run the commands below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add vsftpd&lt;br /&gt;
&lt;br /&gt;
rc-update add vsftpd default&lt;br /&gt;
&lt;br /&gt;
rc-service vsftpd restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== vsftpd Configuration ===&lt;br /&gt;
&lt;br /&gt;
By default, Alpine&#039;s vsftpd package does not provide any special configuration, just vanilla provided so we must specify what we want!&lt;br /&gt;
&lt;br /&gt;
Configurations depends of the purpose of the FTP nature to serve, the most common cases are anonymously ftp service, user system ftp service and virtual users ftp service.. &lt;br /&gt;
&lt;br /&gt;
For production purposes the [[Production FTP virtual users: vsftpd + MySQL]] wiki page will explain in details all the needs for a virtual users case, there&#039;s the [[Production FTP user service: vsftpd]] wiki page with futher information to use with system users and lets encrypt certificates.&lt;br /&gt;
&lt;br /&gt;
Due to the minimalism of alpine linux, &#039;&#039;&#039;unfortunately the vsftpd packaging only provided vanilla configurations not close to alpine or easy admin maintenance&#039;&#039;&#039;, see the [[Production VSFTP system: vsftpd + MySQL + SFTP]] wiki page to goin in deep about configuring lighttpd web server.&lt;br /&gt;
&lt;br /&gt;
==== Controlling vsftpd ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Start vsftpd&#039;&#039;&#039;&#039;&#039;: After the installation {{Pkg|vsftpd}} is not running. As we said in first section, was started already but if you want to start {{Pkg|vsftpd}} manually use:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd start}}&lt;br /&gt;
&lt;br /&gt;
You will get a feedback about the status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Caching service dependencies ...                           [ ok ]&lt;br /&gt;
 * Starting vsftpd...                                         [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Stop vsftpd&#039;&#039;&#039;&#039;&#039;: If you want to stop the web server use &#039;&#039;stop&#039;&#039; in the same way of previous command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd stop}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Restart lighttpd&#039;&#039;&#039;&#039;&#039;: After changing the configuration file lighttpd needs to be restarted.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd restart}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Proper Runlevel&#039;&#039;&#039;&#039;&#039;: By default no services are added to start process, sysadmin must know what we want and what will services do, also other main reason are due in dockers there&#039;s no runlevels per se and Alpine linux are mostly used in dockers containers. You must added the servide only to the default runlevel, not to boot, because need networking activated&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add vsftpd default}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Testing vsftpd ===&lt;br /&gt;
&lt;br /&gt;
This section is assuming that vsftpd is running. Well, at the moment there is no user ftp allowed available but the server is up and running.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|nc -zv 127.0.0.1 21}}&lt;br /&gt;
&lt;br /&gt;
Note that we used &amp;quot;127.0.0.1&amp;quot; if you are using alpine as the only machine for all as your main desktop/pc/machine.&lt;br /&gt;
&lt;br /&gt;
If you are using alpine remotely as web server and just install it the package, change &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;127.0.0.1&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; with IP of the alpine machine. The &amp;quot;webserveripaddres&amp;quot; are the IP address of your setup/server machine.&lt;br /&gt;
&lt;br /&gt;
The common response will be &#039;&#039;&#039;OPEN&#039;&#039;&#039; if server are running.&lt;br /&gt;
&lt;br /&gt;
=== See also about vsftpd ===&lt;br /&gt;
&lt;br /&gt;
* [[Production Lets Encrypt: dehydrated]]&lt;br /&gt;
* [[Production FTP user service: vsftpd]]&lt;br /&gt;
* [[Production FTP virtual users: vsftpd + MySQL]]&lt;br /&gt;
* [[Production VSFTP system: vsftpd + MySQL + SFTP]]&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
&lt;br /&gt;
= FTP clients =&lt;br /&gt;
&lt;br /&gt;
As FTP uses a client-server architecture, you will need an FTP client if you want to interact with an FTP server. Alpine Linux provides two packages for command line and batch processing of FTP protocol, apart of the {{Pkg|firefox}} package: the {{Pkg|lftp}} and the {{Pkg|ncftp}} packages.&lt;br /&gt;
&lt;br /&gt;
* GUI programs:&lt;br /&gt;
** {{Pkg|pcmanfm}}. Check out [[#PCManFM with GVfs]]&lt;br /&gt;
** {{Pkg|firefox}}&lt;br /&gt;
* CLI programs:&lt;br /&gt;
** {{Pkg|lftp}}. Check out [[#lftp]]&lt;br /&gt;
** {{Pkg|ncftp}}&lt;br /&gt;
&lt;br /&gt;
So then, &#039;&#039;&#039;commonly a web browser (firefox) supports FTP protocol&#039;&#039;&#039; so our FTP server just configured can be &#039;&#039;&#039;browsed using the address &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ftp://&amp;lt;webserveripaddres&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; The &amp;quot;webserveripaddres&amp;quot; are the ip address of your setup/server machine.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== lftp ==&lt;br /&gt;
&lt;br /&gt;
LFTP is a sophisticated file transfer program that supports a number of network protocols. Such include FTP, HTTP, SFTP, FISH, and BitTorrent (and potentially more). &lt;br /&gt;
&lt;br /&gt;
lftp has the following features:&lt;br /&gt;
&lt;br /&gt;
* Has job control and..&lt;br /&gt;
* uses the readline library for input. &lt;br /&gt;
* It has bookmarks, &lt;br /&gt;
* Has built-in mirror command&lt;br /&gt;
* Can transfer several files in parallel.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature !! Value/Name !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Main package name || lftp || Install: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || Install: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (system) || {{Path|/etc/lftp.conf}} || This is just a default configuration file (no Alpine customizations).&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftprc}} || The first user configuration file to read from.&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftp/rc}} || Second user configuration file to read from (if there&#039;s a problem with the first one).&lt;br /&gt;
|-&lt;br /&gt;
| Written in || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing lftp ===&lt;br /&gt;
&lt;br /&gt;
To install lftp, run the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add lftp&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lftp has been provided in the main repository since Alpine 3.6, so it&#039;s a supported package that&#039;s ready for production use.&lt;br /&gt;
&lt;br /&gt;
=== Configuring lftp ===&lt;br /&gt;
&lt;br /&gt;
The main configuration file, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;/etc/lftp.conf&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; comes with various examples and comments. On startup, lftp reads &amp;lt;code&amp;gt;/etc/lftp.conf&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;~/.lftprc&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;~/.lftp/rc&amp;lt;/code&amp;gt; (in the specified order). You can use those files to set system-wide and user-specific settings.&lt;br /&gt;
&lt;br /&gt;
In your configuration file, simply use the command set followed by the name of the setting, followed by its value. Use on/off for boolean values. Check this example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:ssl-force on&lt;br /&gt;
set ssl:verify-certificate on&lt;br /&gt;
set ftp:use-feat off&lt;br /&gt;
set ftp:ssl-protect-data on&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can set specific settings for specific servers only. Simply append a slash (/) and the server name to the setting.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:use-feat off /example.com&lt;br /&gt;
set ftp:ssl-force on /example.com&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The closure for `dns:&#039;, `net:&#039;, `ftp:&#039;, `http:&#039;, `hftp:&#039; domain variables is currently just the host name as you specify it in the `open&#039; command (with some exceptions where closure is meaningless, e.g. dns:cache-size). For some `cmd:&#039; domain variables the closure is current URL without path. For other variables it is not currently used. See examples in the sample lftp.conf.}}&lt;br /&gt;
&lt;br /&gt;
=== General lftp usage examples ===&lt;br /&gt;
&lt;br /&gt;
By default, lftp is silent about the operations it performs in the background. If you need some more output, e.g. for debugging purposes, you can use the &#039;debug&#039; command (without the &#039;set&#039; command):&lt;br /&gt;
&lt;br /&gt;
* debug 5 will display the full debug output.&lt;br /&gt;
* debug 3 will only display greeting messages and error messages.&lt;br /&gt;
&lt;br /&gt;
Note that if you use the -d switch from the command line, the debug setting will be overruled and the full debug output will be displayed.&lt;br /&gt;
&lt;br /&gt;
If you prefer some commands to be called by another name, you can set aliases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alias dir ls&lt;br /&gt;
alias less more&lt;br /&gt;
alias zless zmore&lt;br /&gt;
alias bzless bzmore&lt;br /&gt;
alias reconnect &amp;quot;close; cache flush; cd .&amp;quot;&lt;br /&gt;
alias edit &amp;quot;eval -f &amp;quot;get $0 -o ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; shell \\&amp;quot;cp -p ~/.lftp/edit.tmp.$$ ~/.lftp/edit.tmp.$$.orig &amp;amp;&amp;amp; vim ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; test ~/.lftp/edit.tmp.$$ -nt ~/.lftp/edit.tmp.$$.orig\\&amp;quot; &amp;amp;&amp;amp; put ~/.lftp/edit.tmp.$$ -o $0; shell rm -f ~/.lftp/edit.tmp.$$*&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last alias (edit) should be all in one line. It allows you to get a remote file, edit it with vim (change as needed), and place the edited file back on the server. This is very convenient!&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Example usage&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a mult-part download over the SFTP protocol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;$ lftp -e &#039;pget -c -n 5 /path/to/file&#039; sftp://username@server&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
short explanation:&lt;br /&gt;
&lt;br /&gt;
* -e: lftp option to execute command&lt;br /&gt;
* pget: is the command for partial download&lt;br /&gt;
* -c: pget option to resume&lt;br /&gt;
* -n: pget option for number of parts&lt;br /&gt;
&lt;br /&gt;
== PCManFM with GVfs ==&lt;br /&gt;
&lt;br /&gt;
While PCManFM is a filemanager, by using the {{Pkg|gvfs}} plugin, we can use PCManFM as a graphical FTP client. To use PCManFM as an FTP client, you can do the following:&lt;br /&gt;
&lt;br /&gt;
# From the menubar open the &amp;quot;go&amp;quot; menu&lt;br /&gt;
# Choose &amp;quot;Connect to a server&amp;quot;&lt;br /&gt;
# Choose the FTP protocol and input username (path is optional)&lt;br /&gt;
# After a while you will input the password&lt;br /&gt;
&lt;br /&gt;
Check the picture for further reference:&lt;br /&gt;
&lt;br /&gt;
[[File:Ftp-gui-pcmanfm_at_2020-09-11_14-13-03.png]]&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
* https://pkgs.alpinelinux.org/packages?name=tftp-hpa related to [[PXE boot]]&lt;br /&gt;
link&lt;br /&gt;
[[Category:Newbie]]&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Web_Server]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pinetree</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=18642</id>
		<title>FTP</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=18642"/>
		<updated>2021-02-09T19:31:21Z</updated>

		<summary type="html">&lt;p&gt;Pinetree: Fixed broken in-page link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;FTP (or &#039;&#039;&#039;F&#039;&#039;&#039;ile &#039;&#039;&#039;T&#039;&#039;&#039;ransfer &#039;&#039;&#039;P&#039;&#039;&#039;rotocol) is a protocol that allows you to transfer files from a server to a client and vice versa (as FTP uses a client-server architecture). FTP is among the oldest protocols as its origins can be traced as far back as 1971 (more on [https://en.wikipedia.org/wiki/Ftp#History_of_FTP_servers Wikipedia]).&lt;br /&gt;
&lt;br /&gt;
There are also varients of FTP. Such include SFTP (SSH FTP, not to be confused with Simple FTP), FTPS (FTP SSL), and others. SFTP, as the name implies, is done over SSH. FTPS is plain FTP with TLS/SSL encryption.&lt;br /&gt;
&lt;br /&gt;
Alpine Linux has various FTP clients and servers that you can install and use:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|vsftpd}} (server)&lt;br /&gt;
* {{Pkg|ncftp}} (client)&lt;br /&gt;
* {{Pkg|lftpd}} (client, but see below for more details).&lt;br /&gt;
* You can also use {{Pkg|pcmanfm}} with the {{Pkg|gvfs}} plugin as a graphical FTP client.&lt;br /&gt;
&lt;br /&gt;
There are also plenty of other clients available too. However, we will only be covering the clients and servers mentioned above. &lt;br /&gt;
&lt;br /&gt;
= FTP Server: vsftpd =&lt;br /&gt;
&lt;br /&gt;
In Alpine Linux the default FTP server is {{Pkg|vsftpd}}. However, it is not very used due common hosting panels does not handle it&#039;s configurations management. In constrast {{Pkg|vsftpd}} are secured respect rest of others without so much updates.&lt;br /&gt;
&lt;br /&gt;
=== FTP server: About vsftpd package ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;It was the most secured FTP server&#039;&#039;&#039;.  It is the default FTP server in NimbleX, Slackware, and many others.&lt;br /&gt;
&lt;br /&gt;
{{Note|As for minimal FTP&#039;s and fast server purposes are very recommended due it easy configuration process and perfect performance without much configuration.}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature !! Value/Name !! Observations&lt;br /&gt;
|-&lt;br /&gt;
| Package name || vsftpd || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file || {{Path|/etc/vsftpd/vsftpd.conf}} || It&#039;s not close to alpine, just vanilla provived!&lt;br /&gt;
|-&lt;br /&gt;
| Default path for files || {{Path|/var/lib/ftp}} || cos anonnimous are default, is home for daemon user&lt;br /&gt;
|-&lt;br /&gt;
| Log files (error, access, etc) || {{Path|/var/log/vsftpd.log}} || Defined in vsftp.conf also&lt;br /&gt;
|-&lt;br /&gt;
| User running the service || vsftpd || Others Linux used &amp;quot;ftp&amp;quot; alpine has as a group&lt;br /&gt;
|-&lt;br /&gt;
| Group to common to || vsftpd || Used to share things among others daemons or services, like Redis or Apache files&lt;br /&gt;
|-&lt;br /&gt;
| Written in || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Important Limitations ====&lt;br /&gt;
&lt;br /&gt;
vsftp does not support SFTP, but it does have support for FTPS.&lt;br /&gt;
&lt;br /&gt;
=== Install vsftpd ===&lt;br /&gt;
&lt;br /&gt;
The installation does not work out of the box, cos enable by default anonymous access is enabled and it only works with IPv4 only.&lt;br /&gt;
&lt;br /&gt;
Per user ftp files can be supported by special directive in the vsftp.conf file using &amp;lt;code&amp;gt;user_sub_token&amp;lt;/code&amp;gt; to something like {{Path|/home/$USER/public_ftp}} directory by example if we enable it (process are described below in further section &amp;quot;vsftpd configuration&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|vsftd}} is available in the Alpine Linux repositories. To install, simply launch the commands below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add vsftpd&lt;br /&gt;
&lt;br /&gt;
rc-update add vsftpd default&lt;br /&gt;
&lt;br /&gt;
rc-service vsftpd restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== vsftpd Configuration ===&lt;br /&gt;
&lt;br /&gt;
By default, Alpine&#039;s vsftpd package does not provide any special configuration, just vanilla provided so we must specify what we want!&lt;br /&gt;
&lt;br /&gt;
Configurations depends of the purpose of the FTP nature to serve, the most common cases are anonymously ftp service, user system ftp service and virtual users ftp service.. &lt;br /&gt;
&lt;br /&gt;
For production purposes the [[Production FTP virtual users: vsftpd + MySQL]] wiki page will explain in details all the needs for a virtual users case, there&#039;s the [[Production FTP user service: vsftpd]] wiki page with futher information to use with system users and lets encrypt certificates.&lt;br /&gt;
&lt;br /&gt;
Due to the minimalism of alpine linux, &#039;&#039;&#039;unfortunately the vsftpd packaging only provided vanilla configurations not close to alpine or easy admin maintenance&#039;&#039;&#039;, see the [[Production VSFTP system: vsftpd + MySQL + SFTP]] wiki page to goin in deep about configuring lighttpd web server.&lt;br /&gt;
&lt;br /&gt;
==== Controlling vsftpd ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Start vsftpd&#039;&#039;&#039;&#039;&#039;: After the installation {{Pkg|vsftpd}} is not running. As we said in first section, was started already but if you want to start {{Pkg|vsftpd}} manually use:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd start}}&lt;br /&gt;
&lt;br /&gt;
You will get a feedback about the status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Caching service dependencies ...                           [ ok ]&lt;br /&gt;
 * Starting vsftpd...                                         [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Stop vsftpd&#039;&#039;&#039;&#039;&#039;: If you want to stop the web server use &#039;&#039;stop&#039;&#039; in the same way of previous command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd stop}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Restart lighttpd&#039;&#039;&#039;&#039;&#039;: After changing the configuration file lighttpd needs to be restarted.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd restart}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Proper Runlevel&#039;&#039;&#039;&#039;&#039;: By default no services are added to start process, sysadmin must know what we want and what will services do, also other main reason are due in dockers there&#039;s no runlevels per se and Alpine linux are mostly used in dockers containers. You must added the servide only to the default runlevel, not to boot, because need networking activated&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add vsftpd default}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Testing vsftpd ===&lt;br /&gt;
&lt;br /&gt;
This section is assuming that vsftpd is running. Well, at the moment there is no user ftp allowed available but the server is up and running.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|nc -zv 127.0.0.1 21}}&lt;br /&gt;
&lt;br /&gt;
Note that we used &amp;quot;127.0.0.1&amp;quot; if you are using alpine as the only machine for all as your main desktop/pc/machine.&lt;br /&gt;
&lt;br /&gt;
If you are using alpine remotely as web server and just install it the package, change &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;127.0.0.1&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; with IP of the alpine machine. The &amp;quot;webserveripaddres&amp;quot; are the IP address of your setup/server machine.&lt;br /&gt;
&lt;br /&gt;
The common response will be &#039;&#039;&#039;OPEN&#039;&#039;&#039; if server are running.&lt;br /&gt;
&lt;br /&gt;
=== See also about vsftpd ===&lt;br /&gt;
&lt;br /&gt;
* [[Production Lets Encrypt: dehydrated]]&lt;br /&gt;
* [[Production FTP user service: vsftpd]]&lt;br /&gt;
* [[Production FTP virtual users: vsftpd + MySQL]]&lt;br /&gt;
* [[Production VSFTP system: vsftpd + MySQL + SFTP]]&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
&lt;br /&gt;
= FTP clients =&lt;br /&gt;
&lt;br /&gt;
As FTP uses a client-server architecture, you will need an FTP client if you want to interact with an FTP server. Alpine Linux provides two packages for command line and batch processing of FTP protocol, apart of the {{Pkg|firefox}} package: the {{Pkg|lftp}} and the {{Pkg|ncftp}} packages.&lt;br /&gt;
&lt;br /&gt;
* GUI programs:&lt;br /&gt;
** {{Pkg|pcmanfm}}. Check out [[#PCManFM with GVfs]]&lt;br /&gt;
** {{Pkg|firefox}}&lt;br /&gt;
* CLI programs:&lt;br /&gt;
** {{Pkg|lftp}}. Check out [[#lftp]]&lt;br /&gt;
** {{Pkg|ncftp}}&lt;br /&gt;
&lt;br /&gt;
So then, &#039;&#039;&#039;commonly a web browser (firefox) supports FTP protocol&#039;&#039;&#039; so our FTP server just configured can be &#039;&#039;&#039;browsed using the address &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ftp://&amp;lt;webserveripaddres&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; The &amp;quot;webserveripaddres&amp;quot; are the ip address of your setup/server machine.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== lftp ==&lt;br /&gt;
&lt;br /&gt;
LFTP is a sophisticated file transfer program that supports a number of network protocols. Such include FTP, HTTP, SFTP, FISH, and BitTorrent (and potentially more). &lt;br /&gt;
&lt;br /&gt;
lftp has the following features:&lt;br /&gt;
&lt;br /&gt;
* Has job control and..&lt;br /&gt;
* uses the readline library for input. &lt;br /&gt;
* It has bookmarks, &lt;br /&gt;
* Has built-in mirror command&lt;br /&gt;
* Can transfer several files in parallel.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature !! Value/Name !! Observations&lt;br /&gt;
|-&lt;br /&gt;
| Main package name || lftp || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (system) || {{Path|/etc/lftp.conf}} || It&#039;s not close to alpine, just vanilla provived!&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftprc}} || if found the first to parse!&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftp/rc}} || second attempt to parse if first not found!&lt;br /&gt;
|-&lt;br /&gt;
| Written in || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing lftp ===&lt;br /&gt;
&lt;br /&gt;
lftp has been provided in the main repository since 3.6, so &#039;&#039;&#039;is a team supported package ready for production&#039;&#039;&#039; deploys.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add lftp&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring lftp ===&lt;br /&gt;
&lt;br /&gt;
The main configuration file, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;/etc/lftp.conf&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; comes with various examples and comments. On startup, lftp executes &amp;lt;code&amp;gt;/etc/lftp.conf&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;~/.lftprc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;~/.lftp/rc&amp;lt;/code&amp;gt;. You can use those files to set system-wide and user-specific settings.&lt;br /&gt;
&lt;br /&gt;
In your configuration file, simply use the command set followed by the name of the setting, followed by its value. Use on/off for boolean values. Check this example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:ssl-force on&lt;br /&gt;
set ssl:verify-certificate on&lt;br /&gt;
set ftp:use-feat off&lt;br /&gt;
set ftp:ssl-protect-data on&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can set specific settings for specific servers only. Simply append a slash (/) and the server name to the setting.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:use-feat off /example.com&lt;br /&gt;
set ftp:ssl-force on /example.com&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The closure for `dns:&#039;, `net:&#039;, `ftp:&#039;, `http:&#039;, `hftp:&#039; domain variables is currently just the host name as you specify it in the `open&#039; command (with some exceptions where closure is meaningless, e.g. dns:cache-size). For some `cmd:&#039; domain variables the closure is current URL without path. For other variables it is not currently used. See examples in the sample lftp.conf.}}&lt;br /&gt;
&lt;br /&gt;
=== General lftp usage examples ===&lt;br /&gt;
&lt;br /&gt;
By default, lftp is silent about the operations it performs in the background. If you need some more output, e.g. for debugging purposes, you can use the &#039;debug&#039; command (without the &#039;set&#039; command):&lt;br /&gt;
&lt;br /&gt;
* debug 5 will display the full debug output.&lt;br /&gt;
* debug 3 will only display greeting messages and error messages.&lt;br /&gt;
&lt;br /&gt;
Note that if you use the -d switch from the command line, the debug setting will be overruled and the full debug output will be displayed.&lt;br /&gt;
&lt;br /&gt;
If you prefer some commands to be called by another name, you can set aliases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alias dir ls&lt;br /&gt;
alias less more&lt;br /&gt;
alias zless zmore&lt;br /&gt;
alias bzless bzmore&lt;br /&gt;
alias reconnect &amp;quot;close; cache flush; cd .&amp;quot;&lt;br /&gt;
alias edit &amp;quot;eval -f &amp;quot;get $0 -o ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; shell \\&amp;quot;cp -p ~/.lftp/edit.tmp.$$ ~/.lftp/edit.tmp.$$.orig &amp;amp;&amp;amp; vim ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; test ~/.lftp/edit.tmp.$$ -nt ~/.lftp/edit.tmp.$$.orig\\&amp;quot; &amp;amp;&amp;amp; put ~/.lftp/edit.tmp.$$ -o $0; shell rm -f ~/.lftp/edit.tmp.$$*&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last alias (edit) should be all in one line. It allows you to get a remote file, edit it with vim (change as needed), and place the edited file back on the server. This is very convenient!&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Example usage&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a mult-part download over the SFTP protocol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;$ lftp -e &#039;pget -c -n 5 /path/to/file&#039; sftp://username@server&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
short explanation:&lt;br /&gt;
&lt;br /&gt;
* -e: lftp option to execute command&lt;br /&gt;
* pget: is the command for partial download&lt;br /&gt;
* -c: pget option to resume&lt;br /&gt;
* -n: pget option for number of parts&lt;br /&gt;
&lt;br /&gt;
== PCManFM with GVfs ==&lt;br /&gt;
&lt;br /&gt;
While PCManFM is a filemanager, by using the {{Pkg|gvfs}} plugin, we can use PCManFM as a graphical FTP client. To use PCManFM as an FTP client, you can do the following:&lt;br /&gt;
&lt;br /&gt;
# From the menubar open the &amp;quot;go&amp;quot; menu&lt;br /&gt;
# Choose &amp;quot;Connect to a server&amp;quot;&lt;br /&gt;
# Choose the FTP protocol and input username (path is optional)&lt;br /&gt;
# After a while you will input the password&lt;br /&gt;
&lt;br /&gt;
Check the picture for further reference:&lt;br /&gt;
&lt;br /&gt;
[[File:Ftp-gui-pcmanfm_at_2020-09-11_14-13-03.png]]&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
* https://pkgs.alpinelinux.org/packages?name=tftp-hpa related to [[PXE boot]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Newbie]]&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Web_Server]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pinetree</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=18641</id>
		<title>FTP</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=18641"/>
		<updated>2021-02-09T19:28:36Z</updated>

		<summary type="html">&lt;p&gt;Pinetree: Added more info about FTP, more typo fixes and improvements&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;FTP (or &#039;&#039;&#039;F&#039;&#039;&#039;ile &#039;&#039;&#039;T&#039;&#039;&#039;ransfer &#039;&#039;&#039;P&#039;&#039;&#039;rotocol) is a protocol that allows you to transfer files from a server to a client and vice versa (as FTP uses a client-server architecture). FTP is among the oldest protocols as its origins can be traced as far back as 1971 (more on [https://en.wikipedia.org/wiki/Ftp#History_of_FTP_servers Wikipedia]).&lt;br /&gt;
&lt;br /&gt;
There are also varients of FTP. Such include SFTP (SSH FTP, not to be confused with Simple FTP), FTPS (FTP SSL), and others. SFTP, as the name implies, is done over SSH. FTPS is plain FTP with TLS/SSL encryption.&lt;br /&gt;
&lt;br /&gt;
Alpine Linux has various FTP clients and servers that you can install and use:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|vsftpd}} (server)&lt;br /&gt;
* {{Pkg|ncftp}} (client)&lt;br /&gt;
* {{Pkg|lftpd}} (client, but see below for more details).&lt;br /&gt;
* You can also use {{Pkg|pcmanfm}} with the {{Pkg|gvfs}} plugin as a graphical FTP client.&lt;br /&gt;
&lt;br /&gt;
There are also plenty of other clients available too. However, we will only be covering the clients and servers mentioned above. &lt;br /&gt;
&lt;br /&gt;
= FTP Server: vsftpd =&lt;br /&gt;
&lt;br /&gt;
In Alpine Linux the default FTP server is {{Pkg|vsftpd}}. However, it is not very used due common hosting panels does not handle it&#039;s configurations management. In constrast {{Pkg|vsftpd}} are secured respect rest of others without so much updates.&lt;br /&gt;
&lt;br /&gt;
=== FTP server: About vsftpd package ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;It was the most secured FTP server&#039;&#039;&#039;.  It is the default FTP server in NimbleX, Slackware, and many others.&lt;br /&gt;
&lt;br /&gt;
{{Note|As for minimal FTP&#039;s and fast server purposes are very recommended due it easy configuration process and perfect performance without much configuration.}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature !! Value/Name !! Observations&lt;br /&gt;
|-&lt;br /&gt;
| Package name || vsftpd || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file || {{Path|/etc/vsftpd/vsftpd.conf}} || It&#039;s not close to alpine, just vanilla provived!&lt;br /&gt;
|-&lt;br /&gt;
| Default path for files || {{Path|/var/lib/ftp}} || cos anonnimous are default, is home for daemon user&lt;br /&gt;
|-&lt;br /&gt;
| Log files (error, access, etc) || {{Path|/var/log/vsftpd.log}} || Defined in vsftp.conf also&lt;br /&gt;
|-&lt;br /&gt;
| User running the service || vsftpd || Others Linux used &amp;quot;ftp&amp;quot; alpine has as a group&lt;br /&gt;
|-&lt;br /&gt;
| Group to common to || vsftpd || Used to share things among others daemons or services, like Redis or Apache files&lt;br /&gt;
|-&lt;br /&gt;
| Written in || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Important Limitations ====&lt;br /&gt;
&lt;br /&gt;
vsftp does not support SFTP, but it does have support for FTPS.&lt;br /&gt;
&lt;br /&gt;
=== Install vsftpd ===&lt;br /&gt;
&lt;br /&gt;
The installation does not work out of the box, cos enable by default anonymous access is enabled and it only works with IPv4 only.&lt;br /&gt;
&lt;br /&gt;
Per user ftp files can be supported by special directive in the vsftp.conf file using &amp;lt;code&amp;gt;user_sub_token&amp;lt;/code&amp;gt; to something like {{Path|/home/$USER/public_ftp}} directory by example if we enable it (process are described below in further section &amp;quot;vsftpd configuration&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|vsftd}} is available in the Alpine Linux repositories. To install, simply launch the commands below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add vsftpd&lt;br /&gt;
&lt;br /&gt;
rc-update add vsftpd default&lt;br /&gt;
&lt;br /&gt;
rc-service vsftpd restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== vsftpd Configuration ===&lt;br /&gt;
&lt;br /&gt;
By default, Alpine&#039;s vsftpd package does not provide any special configuration, just vanilla provided so we must specify what we want!&lt;br /&gt;
&lt;br /&gt;
Configurations depends of the purpose of the FTP nature to serve, the most common cases are anonymously ftp service, user system ftp service and virtual users ftp service.. &lt;br /&gt;
&lt;br /&gt;
For production purposes the [[Production FTP virtual users: vsftpd + MySQL]] wiki page will explain in details all the needs for a virtual users case, there&#039;s the [[Production FTP user service: vsftpd]] wiki page with futher information to use with system users and lets encrypt certificates.&lt;br /&gt;
&lt;br /&gt;
Due to the minimalism of alpine linux, &#039;&#039;&#039;unfortunately the vsftpd packaging only provided vanilla configurations not close to alpine or easy admin maintenance&#039;&#039;&#039;, see the [[Production VSFTP system: vsftpd + MySQL + SFTP]] wiki page to goin in deep about configuring lighttpd web server.&lt;br /&gt;
&lt;br /&gt;
==== Controlling vsftpd ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Start vsftpd&#039;&#039;&#039;&#039;&#039;: After the installation {{Pkg|vsftpd}} is not running. As we said in first section, was started already but if you want to start {{Pkg|vsftpd}} manually use:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd start}}&lt;br /&gt;
&lt;br /&gt;
You will get a feedback about the status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Caching service dependencies ...                           [ ok ]&lt;br /&gt;
 * Starting vsftpd...                                         [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Stop vsftpd&#039;&#039;&#039;&#039;&#039;: If you want to stop the web server use &#039;&#039;stop&#039;&#039; in the same way of previous command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd stop}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Restart lighttpd&#039;&#039;&#039;&#039;&#039;: After changing the configuration file lighttpd needs to be restarted.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd restart}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Proper Runlevel&#039;&#039;&#039;&#039;&#039;: By default no services are added to start process, sysadmin must know what we want and what will services do, also other main reason are due in dockers there&#039;s no runlevels per se and Alpine linux are mostly used in dockers containers. You must added the servide only to the default runlevel, not to boot, because need networking activated&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add vsftpd default}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Testing vsftpd ===&lt;br /&gt;
&lt;br /&gt;
This section is assuming that vsftpd is running. Well, at the moment there is no user ftp allowed available but the server is up and running.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|nc -zv 127.0.0.1 21}}&lt;br /&gt;
&lt;br /&gt;
Note that we used &amp;quot;127.0.0.1&amp;quot; if you are using alpine as the only machine for all as your main desktop/pc/machine.&lt;br /&gt;
&lt;br /&gt;
If you are using alpine remotely as web server and just install it the package, change &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;127.0.0.1&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; with IP of the alpine machine. The &amp;quot;webserveripaddres&amp;quot; are the IP address of your setup/server machine.&lt;br /&gt;
&lt;br /&gt;
The common response will be &#039;&#039;&#039;OPEN&#039;&#039;&#039; if server are running.&lt;br /&gt;
&lt;br /&gt;
=== See also about vsftpd ===&lt;br /&gt;
&lt;br /&gt;
* [[Production Lets Encrypt: dehydrated]]&lt;br /&gt;
* [[Production FTP user service: vsftpd]]&lt;br /&gt;
* [[Production FTP virtual users: vsftpd + MySQL]]&lt;br /&gt;
* [[Production VSFTP system: vsftpd + MySQL + SFTP]]&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
&lt;br /&gt;
= FTP clients =&lt;br /&gt;
&lt;br /&gt;
As FTP uses a client-server architecture, you will need an FTP client if you want to interact with an FTP server. Alpine Linux provides two packages for command line and batch processing of FTP protocol, apart of the {{Pkg|firefox}} package: the {{Pkg|lftp}} and the {{Pkg|ncftp}} packages.&lt;br /&gt;
&lt;br /&gt;
* GUI programs:&lt;br /&gt;
** {{Pkg|pcmanfm}}. Check out [[#Gui_FTP_client:_About_pcmanfm_package]]&lt;br /&gt;
** {{Pkg|firefox}}&lt;br /&gt;
* CLI programs:&lt;br /&gt;
** {{Pkg|lftp}}. Check out [[#lftp]]&lt;br /&gt;
** {{Pkg|ncftp}}&lt;br /&gt;
&lt;br /&gt;
So then, &#039;&#039;&#039;commonly a web browser (firefox) supports FTP protocol&#039;&#039;&#039; so our FTP server just configured can be &#039;&#039;&#039;browsed using the address &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ftp://&amp;lt;webserveripaddres&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; The &amp;quot;webserveripaddres&amp;quot; are the ip address of your setup/server machine.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== lftp ==&lt;br /&gt;
&lt;br /&gt;
LFTP is a sophisticated file transfer program that supports a number of network protocols. Such include FTP, HTTP, SFTP, FISH, and BitTorrent (and potentially more). &lt;br /&gt;
&lt;br /&gt;
lftp has the following features:&lt;br /&gt;
&lt;br /&gt;
* Has job control and..&lt;br /&gt;
* uses the readline library for input. &lt;br /&gt;
* It has bookmarks, &lt;br /&gt;
* Has built-in mirror command&lt;br /&gt;
* Can transfer several files in parallel.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature !! Value/Name !! Observations&lt;br /&gt;
|-&lt;br /&gt;
| Main package name || lftp || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (system) || {{Path|/etc/lftp.conf}} || It&#039;s not close to alpine, just vanilla provived!&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftprc}} || if found the first to parse!&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftp/rc}} || second attempt to parse if first not found!&lt;br /&gt;
|-&lt;br /&gt;
| Written in || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing lftp ===&lt;br /&gt;
&lt;br /&gt;
lftp has been provided in the main repository since 3.6, so &#039;&#039;&#039;is a team supported package ready for production&#039;&#039;&#039; deploys.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add lftp&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring lftp ===&lt;br /&gt;
&lt;br /&gt;
The main configuration file, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;/etc/lftp.conf&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; comes with various examples and comments. On startup, lftp executes &amp;lt;code&amp;gt;/etc/lftp.conf&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;~/.lftprc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;~/.lftp/rc&amp;lt;/code&amp;gt;. You can use those files to set system-wide and user-specific settings.&lt;br /&gt;
&lt;br /&gt;
In your configuration file, simply use the command set followed by the name of the setting, followed by its value. Use on/off for boolean values. Check this example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:ssl-force on&lt;br /&gt;
set ssl:verify-certificate on&lt;br /&gt;
set ftp:use-feat off&lt;br /&gt;
set ftp:ssl-protect-data on&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can set specific settings for specific servers only. Simply append a slash (/) and the server name to the setting.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:use-feat off /example.com&lt;br /&gt;
set ftp:ssl-force on /example.com&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The closure for `dns:&#039;, `net:&#039;, `ftp:&#039;, `http:&#039;, `hftp:&#039; domain variables is currently just the host name as you specify it in the `open&#039; command (with some exceptions where closure is meaningless, e.g. dns:cache-size). For some `cmd:&#039; domain variables the closure is current URL without path. For other variables it is not currently used. See examples in the sample lftp.conf.}}&lt;br /&gt;
&lt;br /&gt;
=== General lftp usage examples ===&lt;br /&gt;
&lt;br /&gt;
By default, lftp is silent about the operations it performs in the background. If you need some more output, e.g. for debugging purposes, you can use the &#039;debug&#039; command (without the &#039;set&#039; command):&lt;br /&gt;
&lt;br /&gt;
* debug 5 will display the full debug output.&lt;br /&gt;
* debug 3 will only display greeting messages and error messages.&lt;br /&gt;
&lt;br /&gt;
Note that if you use the -d switch from the command line, the debug setting will be overruled and the full debug output will be displayed.&lt;br /&gt;
&lt;br /&gt;
If you prefer some commands to be called by another name, you can set aliases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alias dir ls&lt;br /&gt;
alias less more&lt;br /&gt;
alias zless zmore&lt;br /&gt;
alias bzless bzmore&lt;br /&gt;
alias reconnect &amp;quot;close; cache flush; cd .&amp;quot;&lt;br /&gt;
alias edit &amp;quot;eval -f &amp;quot;get $0 -o ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; shell \\&amp;quot;cp -p ~/.lftp/edit.tmp.$$ ~/.lftp/edit.tmp.$$.orig &amp;amp;&amp;amp; vim ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; test ~/.lftp/edit.tmp.$$ -nt ~/.lftp/edit.tmp.$$.orig\\&amp;quot; &amp;amp;&amp;amp; put ~/.lftp/edit.tmp.$$ -o $0; shell rm -f ~/.lftp/edit.tmp.$$*&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last alias (edit) should be all in one line. It allows you to get a remote file, edit it with vim (change as needed), and place the edited file back on the server. This is very convenient!&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Example usage&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a mult-part download over the SFTP protocol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;$ lftp -e &#039;pget -c -n 5 /path/to/file&#039; sftp://username@server&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
short explanation:&lt;br /&gt;
&lt;br /&gt;
* -e: lftp option to execute command&lt;br /&gt;
* pget: is the command for partial download&lt;br /&gt;
* -c: pget option to resume&lt;br /&gt;
* -n: pget option for number of parts&lt;br /&gt;
&lt;br /&gt;
== PCManFM with GVfs ==&lt;br /&gt;
&lt;br /&gt;
While PCManFM is a filemanager, by using the {{Pkg|gvfs}} plugin, we can use PCManFM as a graphical FTP client. To use PCManFM as an FTP client, you can do the following:&lt;br /&gt;
&lt;br /&gt;
# From the menubar open the &amp;quot;go&amp;quot; menu&lt;br /&gt;
# Choose &amp;quot;Connect to a server&amp;quot;&lt;br /&gt;
# Choose the FTP protocol and input username (path is optional)&lt;br /&gt;
# After a while you will input the password&lt;br /&gt;
&lt;br /&gt;
Check the picture for further reference:&lt;br /&gt;
&lt;br /&gt;
[[File:Ftp-gui-pcmanfm_at_2020-09-11_14-13-03.png]]&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
* https://pkgs.alpinelinux.org/packages?name=tftp-hpa related to [[PXE boot]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Newbie]]&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Web_Server]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pinetree</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=18640</id>
		<title>FTP</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=18640"/>
		<updated>2021-02-09T17:11:11Z</updated>

		<summary type="html">&lt;p&gt;Pinetree: Format fix + some more typo fixes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;FTP (or &#039;&#039;&#039;F&#039;&#039;&#039;ile &#039;&#039;&#039;T&#039;&#039;&#039;ransfer &#039;&#039;&#039;P&#039;&#039;&#039;rotocol) is a protocol that allows you to transfer files from a server to a client and vice versa (as FTP uses a client-server architecture). FTP is among the oldest protocols as its origins can be traced as far back as 1971 (more on [https://en.wikipedia.org/wiki/Ftp#History_of_FTP_servers Wikipedia]).&lt;br /&gt;
&lt;br /&gt;
Alpine Linux has various FTP clients and servers that you can install and use:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|vsftpd}} (server)&lt;br /&gt;
* {{Pkg|ncftp}} (client)&lt;br /&gt;
* {{Pkg|lftpd}} (client, though apparently supports more protocols than just FTP?).&lt;br /&gt;
* You can also use {{Pkg|pcmanfm}} with the {{Pkg|gvfs}} plugin as a graphical FTP client.&lt;br /&gt;
&lt;br /&gt;
There are also plenty of other clients available too. However, for simplicity reasons, we will only be covering the clients and servers mentioned above. &lt;br /&gt;
&lt;br /&gt;
= The FTP service: vsftpd =&lt;br /&gt;
&lt;br /&gt;
In Alpine Linux the default FTP service software is {{Pkg|vsftpd}}.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|vsftpd}} is not very used due common hosting panels does not handle it&#039;s configurations management.. in contrash {{Pkg|vsftpd}} are secured respect rest of others without so much updates.&lt;br /&gt;
&lt;br /&gt;
=== FTP server: About vsftpd package ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;It was the most secured FTP server&#039;&#039;&#039;.  It is the default FTP server in the NimbleX and Slackware Linux distributions and many others.&lt;br /&gt;
&lt;br /&gt;
{{Note|As for minimal FTP&#039;s and fast server purposes are very recommended due it easy configuration process and perfect performance without much configuration.}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature !! Value/Name !! Observations&lt;br /&gt;
|-&lt;br /&gt;
| Main package name || vsftpd || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file || {{Path|/etc/vsftpd/vsftpd.conf}} || It&#039;s not close to alpine, just vanilla provived!&lt;br /&gt;
|-&lt;br /&gt;
| Default place for files || {{Path|/var/lib/ftp}} || cos anonnimous are default, is home for daemon user&lt;br /&gt;
|-&lt;br /&gt;
| Log files (error, access, etc) || {{Path|/var/log/vsftpd.log}} || Defined in vsftp.conf also&lt;br /&gt;
|-&lt;br /&gt;
| User running the service || vsftpd || Others Linux used &amp;quot;ftp&amp;quot; alpine has as a group&lt;br /&gt;
|-&lt;br /&gt;
| Group to common to || vsftpd || Used to share things among others daemons or services, like Redis or Apache files&lt;br /&gt;
|-&lt;br /&gt;
| Written In || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Important Limitations ====&lt;br /&gt;
&lt;br /&gt;
vsftp does not support SFTP, but it does have support for FTPS.&lt;br /&gt;
&lt;br /&gt;
=== Install vsftpd ===&lt;br /&gt;
&lt;br /&gt;
The installation does not work out of the box, cos enable by default anonymous access is enabled and it only works with IPv4 only.&lt;br /&gt;
&lt;br /&gt;
Per user ftp files can be supported by special directive in the vsftp.conf file using &amp;lt;code&amp;gt;user_sub_token&amp;lt;/code&amp;gt; to something like {{Path|/home/$USER/public_ftp}} directory by example if we enable it (process are described below in further section &amp;quot;vsftpd configuration&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|vsftd}} is available in the Alpine Linux repositories. To install, simply launch the commands below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add vsftpd&lt;br /&gt;
&lt;br /&gt;
rc-update add vsftpd default&lt;br /&gt;
&lt;br /&gt;
rc-service vsftpd restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== vsftpd Configuration ===&lt;br /&gt;
&lt;br /&gt;
By default, Alpine&#039;s vsftpd package does not provide any special configuration, just vanilla provided so we must specify what we want!&lt;br /&gt;
&lt;br /&gt;
Configurations depends of the purpose of the FTP nature to serve, the most common cases are anonymously ftp service, user system ftp service and virtual users ftp service.. &lt;br /&gt;
&lt;br /&gt;
For production purposes the [[Production FTP virtual users: vsftpd + MySQL]] wiki page will explain in details all the needs for a virtual users case, there&#039;s the [[Production FTP user service: vsftpd]] wiki page with futher information to use with system users and lets encrypt certificates.&lt;br /&gt;
&lt;br /&gt;
Due to the minimalism of alpine linux, &#039;&#039;&#039;unfortunately the vsftpd packaging only provided vanilla configurations not close to alpine or easy admin maintenance&#039;&#039;&#039;, see the [[Production VSFTP system: vsftpd + MySQL + SFTP]] wiki page to goin in deep about configuring lighttpd web server.&lt;br /&gt;
&lt;br /&gt;
==== Controlling vsftpd ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Start vsftpd&#039;&#039;&#039;&#039;&#039;: After the installation {{Pkg|vsftpd}} is not running. As we said in first section, was started already but if you want to start {{Pkg|vsftpd}} manually use:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd start}}&lt;br /&gt;
&lt;br /&gt;
You will get a feedback about the status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Caching service dependencies ...                           [ ok ]&lt;br /&gt;
 * Starting vsftpd...                                         [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Stop vsftpd&#039;&#039;&#039;&#039;&#039;: If you want to stop the web server use &#039;&#039;stop&#039;&#039; in the same way of previous command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd stop}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Restart lighttpd&#039;&#039;&#039;&#039;&#039;: After changing the configuration file lighttpd needs to be restarted.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd restart}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Proper Runlevel&#039;&#039;&#039;&#039;&#039;: By default no services are added to start process, sysadmin must know what we want and what will services do, also other main reason are due in dockers there&#039;s no runlevels per se and Alpine linux are mostly used in dockers containers. You must added the servide only to the default runlevel, not to boot, because need networking activated&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add vsftpd default}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Testing vsftpd ===&lt;br /&gt;
&lt;br /&gt;
This section is assuming that vsftpd is running. Well, at the moment there is no user ftp allowed available but the server is up and running.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|nc -zv 127.0.0.1 21}}&lt;br /&gt;
&lt;br /&gt;
Note that we used &amp;quot;127.0.0.1&amp;quot; if you are using alpine as the only machine for all as your main desktop/pc/machine.&lt;br /&gt;
&lt;br /&gt;
If you are using alpine remotelly as web server and just install it the package, chnage &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;127.0.0.1&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; with ip of the alpine machine. The &amp;quot;webserveripaddres&amp;quot; are the ip address of your setup/server machine.&lt;br /&gt;
&lt;br /&gt;
The common response will be &#039;&#039;&#039;OPEN&#039;&#039;&#039; if server are running.&lt;br /&gt;
&lt;br /&gt;
=== See also about vsftpd ===&lt;br /&gt;
&lt;br /&gt;
* [[Production Lets Encrypt: dehydrated]]&lt;br /&gt;
* [[Production FTP user service: vsftpd]]&lt;br /&gt;
* [[Production FTP virtual users: vsftpd + MySQL]]&lt;br /&gt;
* [[Production VSFTP system: vsftpd + MySQL + SFTP]]&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
&lt;br /&gt;
= The FTP clients: lftp, pcmanfm and ncftp =&lt;br /&gt;
&lt;br /&gt;
The FTP protocol need also a client support to property used. Alpine Linux provides two packages for command line and batch procesing of FTP protocol, apart of the {{Pkg|firefox}} package: the {{Pkg|lftp}} and the {{Pkg|ncftp}} packages.&lt;br /&gt;
&lt;br /&gt;
* Gui programs:&lt;br /&gt;
** {{Pkg|pcmanfm}} check [[#Gui_FTP_client:_About_pcmanfm_package]]&lt;br /&gt;
** {{Pkg|firefox}}&lt;br /&gt;
* Cli programs:&lt;br /&gt;
** {{Pkg|lftp}} check [[#Cli_FTP_client:_About_lftp_package]]&lt;br /&gt;
** {{Pkg|ncftp}}&lt;br /&gt;
&lt;br /&gt;
So then, &#039;&#039;&#039;commonly a web browser (firefox) supports FTP protocol&#039;&#039;&#039; so our FTP server just configured can be &#039;&#039;&#039;browsed using the address &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ftp://&amp;lt;webserveripaddres&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; The &amp;quot;webserveripaddres&amp;quot; are the ip address of your setup/server machine.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Cli FTP client: About lftp package ==&lt;br /&gt;
&lt;br /&gt;
LFTP is a sophisticated file transfer program supporting a number of network protocols (ftp, http, sftp, fish, torrent). &lt;br /&gt;
&lt;br /&gt;
* Has job control and..&lt;br /&gt;
* uses the readline library for input. &lt;br /&gt;
* It has bookmarks, &lt;br /&gt;
* Has built-in mirror command&lt;br /&gt;
* Can transfer several files in parallel.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature/Artifac !! Value/Name !! Observations&lt;br /&gt;
|-&lt;br /&gt;
| Main package name || lftp || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (system) || {{Path|/etc/lftp.conf}} || It&#039;s not close to alpine, just vanilla provived!&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftprc}} || if found the first to parse!&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftp/rc}} || second attempt to parse if first not found!&lt;br /&gt;
|-&lt;br /&gt;
| Programed on || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing lftp ===&lt;br /&gt;
&lt;br /&gt;
Is provided in main repository since 3.6, so &#039;&#039;&#039;is a team supported package ready for production&#039;&#039;&#039; deploys.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add lftp&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring lftp ===&lt;br /&gt;
&lt;br /&gt;
The main configuration file, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;/etc/lftp.conf&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; comes with various examples and comments. On startup, lftp executes &amp;lt;code&amp;gt;/etc/lftp.conf&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;~/.lftprc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;~/.lftp/rc&amp;lt;/code&amp;gt;. You can use those files to set system-wide and user-specific settings.&lt;br /&gt;
&lt;br /&gt;
In your configuration file, simply use the command set followed by the name of the setting, followed by its value. Use on/off for boolean values. Check this example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:ssl-force on&lt;br /&gt;
set ssl:verify-certificate on&lt;br /&gt;
set ftp:use-feat off&lt;br /&gt;
set ftp:ssl-protect-data on&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can set specific settings for specific servers only. Simply append a slash (/) and the server name to the setting.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:use-feat off /example.com&lt;br /&gt;
set ftp:ssl-force on /example.com&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The closure for `dns:&#039;, `net:&#039;, `ftp:&#039;, `http:&#039;, `hftp:&#039; domain variables is currently just the host name as you specify it in the `open&#039; command (with some exceptions where closure is meaningless, e.g. dns:cache-size). For some `cmd:&#039; domain variables the closure is current URL without path. For other variables it is not currently used. See examples in the sample lftp.conf.}}&lt;br /&gt;
&lt;br /&gt;
=== General lftp usage examples ===&lt;br /&gt;
&lt;br /&gt;
By default, lftp is silent about the operations it performs in the background. If you need some more output, e.g. for debugging purposes, you can use the &#039;debug&#039; command (without the &#039;set&#039; command):&lt;br /&gt;
&lt;br /&gt;
* debug 5 will display the full debug output.&lt;br /&gt;
* debug 3 will only display greeting messages and error messages.&lt;br /&gt;
&lt;br /&gt;
Note that if you use the -d switch from the command line, the debug setting will be overruled and the full debug output will be displayed.&lt;br /&gt;
&lt;br /&gt;
If you prefer some commands to be called by another name, you can set aliases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alias dir ls&lt;br /&gt;
alias less more&lt;br /&gt;
alias zless zmore&lt;br /&gt;
alias bzless bzmore&lt;br /&gt;
alias reconnect &amp;quot;close; cache flush; cd .&amp;quot;&lt;br /&gt;
alias edit &amp;quot;eval -f &amp;quot;get $0 -o ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; shell \\&amp;quot;cp -p ~/.lftp/edit.tmp.$$ ~/.lftp/edit.tmp.$$.orig &amp;amp;&amp;amp; vim ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; test ~/.lftp/edit.tmp.$$ -nt ~/.lftp/edit.tmp.$$.orig\\&amp;quot; &amp;amp;&amp;amp; put ~/.lftp/edit.tmp.$$ -o $0; shell rm -f ~/.lftp/edit.tmp.$$*&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last alias (edit) should be all in one line. It allows you to get a remote file, edit it with vim (change as needed), and place the edited file back on the server. This is very convenient!&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Example usage&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a mult-part download over the SFTP protocol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;$ lftp -e &#039;pget -c -n 5 /path/to/file&#039; sftp://username@server&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
short explanation:&lt;br /&gt;
&lt;br /&gt;
* -e: lftp option to execute command&lt;br /&gt;
* pget: is the command for partial download&lt;br /&gt;
* -c: pget option to resume&lt;br /&gt;
* -n: pget option for number of parts&lt;br /&gt;
&lt;br /&gt;
== Gui FTP client: About pcmanfm package ==&lt;br /&gt;
&lt;br /&gt;
PCMAnfM is a filemanager.. that by the usage of the {{Pkg|gvfs}} gio we can use with ftp servers as graphical clients, is easy to use just open the pcmanfm program and then:&lt;br /&gt;
&lt;br /&gt;
# From the bar menu open the &amp;quot;go&amp;quot; menu&lt;br /&gt;
# Then choose &amp;quot;Connect to a server&amp;quot;&lt;br /&gt;
# Choose the FTP protocol and input username (path is optional)&lt;br /&gt;
# After a while you will input the password&lt;br /&gt;
&lt;br /&gt;
Check the picture for furter reference:&lt;br /&gt;
&lt;br /&gt;
[[File:Ftp-gui-pcmanfm_at_2020-09-11_14-13-03.png]]&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
* https://pkgs.alpinelinux.org/packages?name=tftp-hpa related to [[PXE boot]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Newbie]]&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Web_Server]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pinetree</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=18638</id>
		<title>FTP</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=FTP&amp;diff=18638"/>
		<updated>2021-02-08T18:34:39Z</updated>

		<summary type="html">&lt;p&gt;Pinetree: (Attempted to) fix a few typos and errors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;FTP (or &#039;&#039;&#039;F&#039;&#039;&#039;ile &#039;&#039;&#039;T&#039;&#039;&#039;ransfer &#039;&#039;&#039;P&#039;&#039;&#039;rotocol) is a protocol that allows you to transfer files from a server to a client and vice versa (as FTP uses a client-server architecture). FTP is among the oldest protocols as its origins can be traced as far back as 1971 (more on [https://en.wikipedia.org/wiki/Ftp#History_of_FTP_servers Wikipedia]).&lt;br /&gt;
&lt;br /&gt;
Alpine Linux has various FTP clients and servers that you can install and use:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|vsftpd}} (server)&lt;br /&gt;
* {{Pkg|ncftp}} (client)&lt;br /&gt;
* {{Pkg|lftpd}} (client, though apparently supports more protocols than just FTP?).&lt;br /&gt;
* You can also use {{Pkg|pcmanfm}} with the {{Pkg||gvfs}} plugin as a graphical FTP client.&lt;br /&gt;
&lt;br /&gt;
There are also plenty of other clients available too. However, for simplicity reasons, we will only be covering the clients and servers mentioned above. &lt;br /&gt;
&lt;br /&gt;
= The FTP service: vsftpd =&lt;br /&gt;
&lt;br /&gt;
In Alpine Linux the default FTP service software is {{Pkg|vsftpd}}.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|vsftpd}} is not very used due common hosting panels does not handle it&#039;s configurations management.. in contrash {{Pkg|vsftpd}} are secured respect rest of others without so much updates.&lt;br /&gt;
&lt;br /&gt;
=== FTP server: About vsftpd package ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;It was the most secured FTP server&#039;&#039;&#039;.  It is the default FTP server in the NimbleX and Slackware Linux distributions and many others.&lt;br /&gt;
&lt;br /&gt;
{{Note|As for minimal FTP&#039;s and fast server purposes are very recommended due it easy configuration process and perfect performance without much configuration.}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature/Artifac !! Value/Name !! Observations&lt;br /&gt;
|-&lt;br /&gt;
| Main package name || vsftpd || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add vsftpd-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file || {{Path|/etc/vsftpd/vsftpd.conf}} || It&#039;s not close to alpine, just vanilla provived!&lt;br /&gt;
|-&lt;br /&gt;
| Default place for files || {{Path|/var/lib/ftp}} || cos anonnimous are default, is home for daemon user&lt;br /&gt;
|-&lt;br /&gt;
| Log files (error, access, etc) || {{Path|/var/log/vsftpd.log}} || Defined in vsftp.conf also&lt;br /&gt;
|-&lt;br /&gt;
| User running the service || vsftpd || Others Linux used &amp;quot;ftp&amp;quot; alpine has as a group&lt;br /&gt;
|-&lt;br /&gt;
| Group to common to || vsftpd || Used to share things amont others daemons or services, like redis or apache files&lt;br /&gt;
|-&lt;br /&gt;
| Programed on || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Important Limitations ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;No SFTP support, BUT &#039;&#039;has support for FTPS&#039;&#039;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Install vsftpd ===&lt;br /&gt;
&lt;br /&gt;
The installation does not work out of the box, cos enable by default anonimous and ipv4 only.&lt;br /&gt;
&lt;br /&gt;
Per user ftp files can be supported by special directive in the vsftp.conf file using &amp;lt;code&amp;gt;user_sub_token&amp;lt;/code&amp;gt; to somethign like {{Path|/home/$USER/public_ftp}} directory by example if we enable it (process are described below in further section &amp;quot;vsftpd configuration&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|vsftd}} is available in the Alpine Linux repositories. To install, simple launch the commands below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add vsftpd&lt;br /&gt;
&lt;br /&gt;
rc-update add vsftpd default&lt;br /&gt;
&lt;br /&gt;
rc-service vsftpd restart&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== vsftpd Configuration ===&lt;br /&gt;
&lt;br /&gt;
By default alpine vsftpd package does not provide any special configuration, just vanilla provided so we must specify what we want!&lt;br /&gt;
&lt;br /&gt;
Configurations depends of the purpose of the FTP nature to serve, the most common cases are anonymously ftp service, user system ftp service and virtual users ftp service.. &lt;br /&gt;
&lt;br /&gt;
For production purposes the [[Production FTP virtual users: vsftpd + MySQL]] wiki page will explain in details all the needs for a virtual users case, there&#039;s the [[Production FTP user service: vsftpd]] wiki page with futher information to use with system users and lets encrypt certificates.&lt;br /&gt;
&lt;br /&gt;
Due to the minimalism of alpine linux, &#039;&#039;&#039;unfortunately the vsftpd packaging only provided vanilla configurations not close to alpine or easy admin maintenance&#039;&#039;&#039;, see the [[Production VSFTP system: vsftpd + MySQL + SFTP]] wiki page to goin in deep about configuring lighttpd web server.&lt;br /&gt;
&lt;br /&gt;
==== Controlling vsftpd ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Start vsftpd&#039;&#039;&#039;&#039;&#039;: After the installation {{Pkg|vsftpd}} is not running. As we said in first section, was started already but if you want to start {{Pkg|vsftpd}} manually use:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd start}}&lt;br /&gt;
&lt;br /&gt;
You will get a feedback about the status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * Caching service dependencies ...                           [ ok ]&lt;br /&gt;
 * Starting vsftpd...                                         [ ok ]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Stop vsftpd&#039;&#039;&#039;&#039;&#039;: If you want to stop the web server use &#039;&#039;stop&#039;&#039; in the same way of previous command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd stop}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Restart lighttpd&#039;&#039;&#039;&#039;&#039;: After changing the configuration file lighttpd needs to be restarted.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-service vsftpd restart}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Proper Runlevel&#039;&#039;&#039;&#039;&#039;: By default no services are added to start process, sysadmin must know what we want and what will services do, also other main reason are due in dockers there&#039;s no runlevels per se and Alpine linux are mostly used in dockers containers. You must added the servide only to the default runlevel, not to boot, because need networking activated&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add vsftpd default}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Testing vsftpd ===&lt;br /&gt;
&lt;br /&gt;
This section is assuming that vsftpd is running. Well, at the moment there is no user ftp allowed available but the server is up and running.&lt;br /&gt;
&lt;br /&gt;
{{Cmd|nc -zv 127.0.0.1 21}}&lt;br /&gt;
&lt;br /&gt;
Note that we used &amp;quot;127.0.0.1&amp;quot; if you are using alpine as the only machine for all as your main desktop/pc/machine.&lt;br /&gt;
&lt;br /&gt;
If you are using alpine remotelly as web server and just install it the package, chnage &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;127.0.0.1&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; with ip of the alpine machine. The &amp;quot;webserveripaddres&amp;quot; are the ip address of your setup/server machine.&lt;br /&gt;
&lt;br /&gt;
The common response will be &#039;&#039;&#039;OPEN&#039;&#039;&#039; if server are running.&lt;br /&gt;
&lt;br /&gt;
=== See also about vsftpd ===&lt;br /&gt;
&lt;br /&gt;
* [[Production Lets Encrypt: dehydrated]]&lt;br /&gt;
* [[Production FTP user service: vsftpd]]&lt;br /&gt;
* [[Production FTP virtual users: vsftpd + MySQL]]&lt;br /&gt;
* [[Production VSFTP system: vsftpd + MySQL + SFTP]]&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
&lt;br /&gt;
= The FTP clients: lftp, pcmanfm and ncftp =&lt;br /&gt;
&lt;br /&gt;
The FTP protocol need also a client support to property used. Alpine Linux provides two packages for command line and batch procesing of FTP protocol, apart of the {{Pkg|firefox}} package: the {{Pkg|lftp}} and the {{Pkg|ncftp}} packages.&lt;br /&gt;
&lt;br /&gt;
* Gui programs:&lt;br /&gt;
** {{Pkg|pcmanfm}} check [[#Gui_FTP_client:_About_pcmanfm_package]]&lt;br /&gt;
** {{Pkg|firefox}}&lt;br /&gt;
* Cli programs:&lt;br /&gt;
** {{Pkg|lftp}} check [[#Cli_FTP_client:_About_lftp_package]]&lt;br /&gt;
** {{Pkg|ncftp}}&lt;br /&gt;
&lt;br /&gt;
So then, &#039;&#039;&#039;commonly a web browser (firefox) supports FTP protocol&#039;&#039;&#039; so our FTP server just configured can be &#039;&#039;&#039;browsed using the address &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;ftp://&amp;lt;webserveripaddres&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; The &amp;quot;webserveripaddres&amp;quot; are the ip address of your setup/server machine.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Cli FTP client: About lftp package ==&lt;br /&gt;
&lt;br /&gt;
LFTP is a sophisticated file transfer program supporting a number of network protocols (ftp, http, sftp, fish, torrent). &lt;br /&gt;
&lt;br /&gt;
* Has job control and..&lt;br /&gt;
* uses the readline library for input. &lt;br /&gt;
* It has bookmarks, &lt;br /&gt;
* Has built-in mirror command&lt;br /&gt;
* Can transfer several files in parallel.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Feature/Artifac !! Value/Name !! Observations&lt;br /&gt;
|-&lt;br /&gt;
| Main package name || lftp || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Manpages and DOCs packages || vsftpd-doc || &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;apk add lftp-doc&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (system) || {{Path|/etc/lftp.conf}} || It&#039;s not close to alpine, just vanilla provived!&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftprc}} || if found the first to parse!&lt;br /&gt;
|-&lt;br /&gt;
| Configuration file (user) || {{Path|~/.lftp/rc}} || second attempt to parse if first not found!&lt;br /&gt;
|-&lt;br /&gt;
| Programed on || C || Main engine code in C&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Installing lftp ===&lt;br /&gt;
&lt;br /&gt;
Is provided in main repository since 3.6, so &#039;&#039;&#039;is a team supported package ready for production&#039;&#039;&#039; deploys.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
apk add lftp&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring lftp ===&lt;br /&gt;
&lt;br /&gt;
The main configuration file, &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;/etc/lftp.conf&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; comes with various examples and comments. On startup, lftp executes &amp;lt;code&amp;gt;/etc/lftp.conf&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;~/.lftprc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;~/.lftp/rc&amp;lt;/code&amp;gt;. You can use those files to set system-wide and user-specific settings.&lt;br /&gt;
&lt;br /&gt;
In your configuration file, simply use the command set followed by the name of the setting, followed by its value. Use on/off for boolean values. Check this example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:ssl-force on&lt;br /&gt;
set ssl:verify-certificate on&lt;br /&gt;
set ftp:use-feat off&lt;br /&gt;
set ftp:ssl-protect-data on&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can set specific settings for specific servers only. Simply append a slash (/) and the server name to the setting.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
set ftp:use-feat off /example.com&lt;br /&gt;
set ftp:ssl-force on /example.com&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The closure for `dns:&#039;, `net:&#039;, `ftp:&#039;, `http:&#039;, `hftp:&#039; domain variables is currently just the host name as you specify it in the `open&#039; command (with some exceptions where closure is meaningless, e.g. dns:cache-size). For some `cmd:&#039; domain variables the closure is current URL without path. For other variables it is not currently used. See examples in the sample lftp.conf.}}&lt;br /&gt;
&lt;br /&gt;
=== General lftp usage examples ===&lt;br /&gt;
&lt;br /&gt;
By default, lftp is silent about the operations it performs in the background. If you need some more output, e.g. for debugging purposes, you can use the &#039;debug&#039; command (without the &#039;set&#039; command):&lt;br /&gt;
&lt;br /&gt;
* debug 5 will display the full debug output.&lt;br /&gt;
* debug 3 will only display greeting messages and error messages.&lt;br /&gt;
&lt;br /&gt;
Note that if you use the -d switch from the command line, the debug setting will be overruled and the full debug output will be displayed.&lt;br /&gt;
&lt;br /&gt;
If you prefer some commands to be called by another name, you can set aliases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
alias dir ls&lt;br /&gt;
alias less more&lt;br /&gt;
alias zless zmore&lt;br /&gt;
alias bzless bzmore&lt;br /&gt;
alias reconnect &amp;quot;close; cache flush; cd .&amp;quot;&lt;br /&gt;
alias edit &amp;quot;eval -f &amp;quot;get $0 -o ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; shell \\&amp;quot;cp -p ~/.lftp/edit.tmp.$$ ~/.lftp/edit.tmp.$$.orig &amp;amp;&amp;amp; vim ~/.lftp/edit.tmp.$$ &amp;amp;&amp;amp; test ~/.lftp/edit.tmp.$$ -nt ~/.lftp/edit.tmp.$$.orig\\&amp;quot; &amp;amp;&amp;amp; put ~/.lftp/edit.tmp.$$ -o $0; shell rm -f ~/.lftp/edit.tmp.$$*&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last alias (edit) should be all in one line. It allows you to get a remote file, edit it with vim (change as needed), and place the edited file back on the server. This is very convenient!&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Example usage&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a mult-part download over the SFTP protocol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;$ lftp -e &#039;pget -c -n 5 /path/to/file&#039; sftp://username@server&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
short explanation:&lt;br /&gt;
&lt;br /&gt;
* -e: lftp option to execute command&lt;br /&gt;
* pget: is the command for partial download&lt;br /&gt;
* -c: pget option to resume&lt;br /&gt;
* -n: pget option for number of parts&lt;br /&gt;
&lt;br /&gt;
== Gui FTP client: About pcmanfm package ==&lt;br /&gt;
&lt;br /&gt;
PCMAnfM is a filemanager.. that by the usage of the {{Pkg|gvfs}} gio we can use with ftp servers as graphical clients, is easy to use just open the pcmanfm program and then:&lt;br /&gt;
&lt;br /&gt;
# From the bar menu open the &amp;quot;go&amp;quot; menu&lt;br /&gt;
# Then choose &amp;quot;Connect to a server&amp;quot;&lt;br /&gt;
# Choose the FTP protocol and input username (path is optional)&lt;br /&gt;
# After a while you will input the password&lt;br /&gt;
&lt;br /&gt;
Check the picture for furter reference:&lt;br /&gt;
&lt;br /&gt;
[[File:Ftp-gui-pcmanfm_at_2020-09-11_14-13-03.png]]&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[Alpine newbie developer]]&lt;br /&gt;
* [[Alpine newbie lammers]]&lt;br /&gt;
* https://pkgs.alpinelinux.org/packages?name=tftp-hpa related to [[PXE boot]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Newbie]]&lt;br /&gt;
[[Category:Server]]&lt;br /&gt;
[[Category:Web_Server]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Pinetree</name></author>
	</entry>
</feed>