Linux basic configurations - linux ftp http://basicconfig.com/taxonomy/term/15 en Ubuntu ftp client guide http://basicconfig.com/linux-desktop/ubuntu-ftp-client-guide <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>This is a specific guide on how to install and using ftp client in Ubuntu Desktop. We are going to use <b>gftp</b> as an example, which is a quite familiar ftp client in Linux community. The gftp doesn't included by the default, so you need to install it first. Below is a brief information about gftp:</p> <table><tr><td><code>gFTP is a multithreaded FTP client. This version of it runs under X and was written using GLib/GTK+.<br /> gFTP features:<br /> * simultaneous downloads,<br /> * resuming of interrupted file transfers,<br /> * file transfer queues,<br /> * downloading of entire directories,<br /> * FTP and HTTP proxy support,<br /> * remote directory caching,<br /> * passive and non-passive file transfers,<br /> * drag-n-drop support,<br /> * bookmarks menu,<br /> * support for SSH and SSH2 file transfers,<br /> * support FXP transfers,<br /> * stop button, and many more features. Author: Brian Masney <masneyb><br /><br /> Homepage: http://www.gftp.org/<br /></masneyb></code></td> </tr></table><h2>Install gftp in Ubuntu</h2> <p>You can use Ubuntu Add/Remove program in the Applications menu to install gftp. If you prefer package manager, you can use Synaptic Package Manager which can be entered from System menu and then Administration. Here are step by step screenshots example on how to install gftp in Ubuntu using Add/Remove:</p> <p>1) Click Applications menu and choose Add/Remove.</p> <p>2) In the new Add/Remove pane, type <b>gftp</b> in the 'Search' text box:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/01-gftp-search.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/01-gftp-search.png" alt="Search gftp from Ubuntu Add/Remove program screenshot image" /></a></p> <p>3) Tick on the gftp result:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/02-gftp-choose.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/02-gftp-choose.png" alt="Choose gftp to install from Ubuntu Add/Remove program screenshot image" /></a></p> <p>4) Click 'Apply Changes' to install gftp:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/03-gftp-apply-changes.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/03-gftp-apply-changes.png" alt="Click Apply Changes to install gftp from Ubuntu Add/Remove program screenshot image" /></a></p> <p>Here's the full picture of the Ubuntu Add/Remove pane and the complete steps:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/gftp-addremove01.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/gftp-addremove01.png" alt="Install gftp from Ubuntu Add/Remove program steps screenshot image" /></a></p> <h2>gftp basics tutorial</h2> <p>You can open gftp by clicking the Applications menu and then choose gftp from the Internet menu. Below is the gftp interface. There are main menu, remote login shortcut, local section, remote section and ftp progress section.</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/01-gftp-interface.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/01-gftp-interface.png" alt="Image" /></a></p> <p>gftp main menu:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/02-gftp-main-menu.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/02-gftp-main-menu.png" alt="Image" /></a></p> <p>gftp login shortcut:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/02-gftp-login-shortcut.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/02-gftp-login-shortcut.png" alt="Image" /></a></p> <p>gftp local section and remote section:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/03-gftp-local-remote.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/03-gftp-local-remote.png" alt="Image" /></a></p> <p>gftp progress section:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/04-gftp-progress.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/04-gftp-progress.png" alt="Image" /></a></p> <p>Basically, to start using gftp, we need the remote ftp server address and user account information, which is the ftp account username and password. The remote server address can be domain name or IP address. Once you have the information, use the gftp login shortcut to login. Enter remote ftp server address in the 'Host' text box, username in the 'User' and press keyboard 'Enter' key to key in ftp account user password.</p> <p>If you successfully connect to the remote ftp server, you can see the home directory in the remote section. You can always check the 'Progress section' to see what happened if you fail to connect. Double-click the directory that you want to enter in the remote ftp server. The arrow between local section and remote section shows where you can transfer file (local to remote and remote to local).</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/01-using-gftp.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/01-using-gftp.png" alt="gftp arrow to transfer file screenshot image" /></a></p> <p>Here is an example on how to transfer file from local computer to remote ftp server:</p> <p>1) Navigate to the directory you want by double-click in the 'Local section'. Click the '..' at the top to go back to the parent directory (previous directory).</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/02-using-gftp.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/02-using-gftp.png" alt="gftp navigate local computer screenshot image" /></a></p> <p>2) Do the same for the 'Remote section'.</p> <p>3) Click the directory that you want to transfer and then click arrow to begin transferring the directory. If you want to transfer a file, double-click will also do the job.</p> <p>When you are done, click 'Remote' menu and choose 'Disconnect' to terminate the ftp connection.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/15" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux ftp</a></div><div class="field-item odd" rel="dc:subject"><a href="/taxonomy/term/9" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">software</a></div></div></div> Tue, 03 Aug 2010 03:47:05 +0000 jinlusuh 136 at http://basicconfig.com http://basicconfig.com/linux-desktop/ubuntu-ftp-client-guide#comments Install and configure vsftpd in Ubuntu http://basicconfig.com/linux-servers/install-configure-vsftpd-ubuntu <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Transfering computer data can be done easily nowadays using usb thumb drive or external hard disk. However, user must copy directly from your computer every time they need certain data. The convenience way to share data in a network environment is using ftp server. Ftp server lets any user in the network who has permission to access the server to copy data directly from their computer.</p> <p>It's a great idea to setup vsftpd even if you are using Ubuntu desktop for file sharing in your home network or in your work place. You can share data with other users including those using Windows operating system. Here is a guide on how to install vsftpd in Ubuntu desktop with step by step instructions and screenshot images.</p> <p>This tutorial covers:</p> <ul><li><a href="#install-vsftpd">Install vsftpd in Ubuntu desktop</a></li> <li><a href="#config-vsftpd">Configure vsftpd in Ubuntu</a></li> <li><a href="#start-vsftpd">Start and restart vsftpd in Ubuntu</a></li> </ul><h2><a name="install-vsftpd" id="install-vsftpd">Install vsftpd in Ubuntu desktop</a></h2> <p>You can easily install vsftpd ftp server in Ubuntu desktop using Synaptics package manager. To open Synaptics package manager, click <em>System</em>, follow <em>Administration</em>'s child menu and choose <em>Synaptics package manager</em>. Ubuntu will ask for your password to continue. The screenshot image below shows an example of Synaptics package manager pane when you successfully key in your password:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/Screenshot-vsftpd-install.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/Screenshot-vsftpd-install.png" alt="Synaptics package manager screenshot image." /></a></p> <p>Type 'vsftpd' in the <em>Quick search</em> text box. See example below:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/quick-search.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/quick-search.png" alt="Synaptics package manager - Quick search screenshot image." /></a></p> <p>You'll see some packages in the search results. Click on the vsftpd tick box and choose 'Mark for installation':</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/vsftpd-results.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/vsftpd-results.png" alt="Synaptics package manager vsftpd search result screenshot image." /></a></p> <p>You can read a brief information about vsftpd in the description area like in the example below:</p> <table><tr><td><code><b>The Very Secure FTP Daemon</b><br /> A lightweight, efficient FTP server written from the ground up with<br /> security in mind.<br /><br /> vsftpd supports both anonymous and non-anonymous FTP, PAM authentication,<br /> bandwidth limiting, and the Linux sendfile() facility.<br /></code></td> </tr></table><p>Click <em>Apply</em> to install vsftpd ftp server in Ubuntu desktop.</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/Screenshot-Applying-Changes.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/Screenshot-Applying-Changes.png" alt="Synaptics package manager - Apply vsftpd installation screenshot image." /></a></p> <p>It takes a few seconds to apply changes (install) vsftpd in Ubuntu desktop. Click <em>Close</em> when vsftpd installation is finished. Quit Synaptics package manager when you are done.</p> <h2><a name="config-vsftpd" id="config-vsftpd">Configure vsftpd in Ubuntu</a></h2> <p>Open command line 'Terminal' from the <em>Accessories</em> sub-menu in <em>Applications</em>. Open vsftpd configuration file with text editor.</p> <table><tr><td><code>kucing@ubuntu-laptop:~$ <span style="color:red;">sudo vim /etc/vsftpd.conf </span><br /> [sudo] password for kucing:<br /></code></td> </tr></table><p>You can set ftp configuration rules by reading the comment description. Here are example vsftpd configurations to allow anonymous and ubuntu local users:</p> <table><tr><td><code># Allow anonymous FTP? (Beware - allowed by default if you comment this out).<br /><span style="color:red;">anonymous_enable=YES </span><br /> #<br /> # Uncomment this to allow local users to log in.<br /><span style="color:red;">local_enable=YES </span><br /> #<br /></code></td> </tr></table><p>If you want to block anonymous login into the vsftpd ftp server, set 'anonymous_enable=NO'.</p> <p>If you want to allow users to upload data to the vsftpd or create a directory, enable(uncomment) 'write_enable=YES'.</p> <table><tr><td><code># Uncomment this to enable any form of FTP write command.<br /><span style="color:red;">write_enable=YES </span><br /> #<br /></code></td> </tr></table><p>Set umask permission to 022:</p> <table><tr><td><code># Default umask for local users is 077. You may wish to change this to 022,<br /> # if your users expect that (022 is used by most other ftpd's)<br /><span style="color:red;">local_umask=022 </span><br /> #<br /></code></td> </tr></table><p>This is a continuity rules if you want to enable users to upload data to the ftp server and create directory, enable 'anon_upload_enable=YES' and 'anon_mkdir_write_enable=YES':</p> <table><tr><td><code># Uncomment this to allow the anonymous FTP user to upload files. This only<br /> # has an effect if the above global write enable is activated. Also, you will<br /> # obviously need to create a directory writable by the FTP user.<br /><span style="color:red;">anon_upload_enable=YES </span><br /> #<br /> # Uncomment this if you want the anonymous FTP user to be able to create<br /> # new directories.<br /><span style="color:red;">anon_mkdir_write_enable=YES </span><br /></code></td> </tr></table><p>Change data connection time out too 600. The default 120 is too short which will cause a big data transfer failed.</p> <table><tr><td><code># You may change the default value for timing out a data connection.<br /><span style="color:red;">data_connection_timeout=600 </span><br /> #<br /></code></td> </tr></table><p>Enable 'chroot_local_user=YES' to restrict local users to their home directories. This is recommended for security.</p> <table><tr><td><code># You may restrict local users to their home directories. See the FAQ for<br /> # the possible risks in this before using chroot_local_user or<br /> # chroot_list_enable below.<br /><span style="color:red;">chroot_local_user=YES </span><br /> #<br /></code></td> </tr></table><p>That's it. You can leave other rules which is allow by default.</p> <h2><a name="start-vsftpd" id="start-vsftpd">Start and restart vsftpd in Ubuntu</a></h2> <p>Now we can start vsftpd service to begin using ftp server. Here is the command to start vsftpd in Ubuntu:</p> <table><tr><td><code>kucing@ubuntu-laptop:~$ <span style="color:red;">sudo /etc/init.d/vsftpd start</span><br /> [sudo] password for kucing:<br /> * Starting FTP server: vsftpd<br /> /usr/sbin/vsftpd already running.<br /> [fail]<br /></code></td> </tr></table><p>Here is the command to restart vsftpd in Ubuntu if you edit vsftpd configuration file again:</p> <table><tr><td><code>kucing@ubuntu-laptop:~$ <span style="color:red;">sudo /etc/init.d/vsftpd restart </span><br /> * Stopping FTP server: vsftpd [ OK ]<br /> * Starting FTP server: vsftpd [ OK ]<br /> kucing@ubuntu-laptop:~$<br /></code></td> </tr></table><p>That's all. Enjoy!</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/15" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux ftp</a></div><div class="field-item odd" rel="dc:subject"><a href="/taxonomy/term/16" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux server</a></div></div></div> Sun, 06 Sep 2009 14:29:54 +0000 jinlusuh 118 at http://basicconfig.com http://basicconfig.com/linux-servers/install-configure-vsftpd-ubuntu#comments Linux network - Install and configure proftpd in Ubuntu Server http://basicconfig.com/linuxnetwork/install_configure_proftpd_ubuntu_server <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>There are many ftp server packages available for Ubuntu server such as pure-ftpd, proftpd and vsftpd. Proftpd ftp server has been around quite some times in Linux. It is known for its stability and highly configurable. This tutorial is a complete guide on how to setup proftpd as a ftp server in Ubuntu server. Here are the topics covered in this tutorial:</p> <ol><li><a href="#install-proftpd">Install proftpd package in Ubuntu server using apt-get</a></li> <li><a href="#configure-proftpd">Configure proftpd in Ubuntu server</a></li> <li><a href="#restart-proftpd">Restart proftpd service</a></li> <li><a href="#troubleshoot-proftpd">Troubleshooting tips for proftpd error</a></li> <li><a href="#authuserfile-proftpd">Setup AuthUserFile for proftpd authentication</a></li> </ol><h2><a name="install-proftpd" id="install-proftpd">Install proftpd package in Ubuntu server using apt-get</a></h2> <p>Here is an example of how to install proftpd package in Ubuntu Server using apt-get package manager: </p> <table><tr><td><code>luzar@ubuntu:~$ <span style="color:red;">sudo apt-get install proftpd</span><br /> [sudo] password for luzar:<br /> Reading package lists... Done<br /> Building dependency tree<br /> Reading state information... Done<br /> The following extra packages will be installed:<br /> libmysqlclient15off libpq5 mysql-common proftpd-basic proftpd-mod-ldap<br /> proftpd-mod-mysql proftpd-mod-pgsql update-inetd<br /> Suggested packages:<br /> proftpd-doc<br /> The following NEW packages will be installed:<br /> libmysqlclient15off libpq5 mysql-common proftpd proftpd-basic<br /> proftpd-mod-ldap proftpd-mod-mysql proftpd-mod-pgsql update-inetd<br /> 0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.<br /> Need to get 3704kB of archives.<br /> After this operation, 8045kB of additional disk space will be used.<br /> Do you want to continue [Y/n]? <span style="color:red;">Y</span><br /></code></td> </tr></table><p>Apt-get package manager pause the proftpd installation process waiting for your confirmation. Proftpd would use 8045kB of additional disk space. If you have no problem with that, answer <b>Y</b> and apt-get will continue the installation.</p> <p>The second time apt-get pause the installation process is when it needs your confirmation again for proftpd service configuration. Apt-get needs to know whether you want to run proftpd service (or daemon) as inetd or as a standalone service. Normally, ftp service is included in the super server, inetd. If you choose to run proftpd in inetd, it will save resources but will be effected every time inetd is stop or restart. Note that inetd holds many Linux services. It's recommended to run proftpd as a standalone service if you have a higher traffic and resources is not a problem for your server. </p> <p><a href="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/install_proftpd_service.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/thumbs/install_proftpd_service.png" alt="proftpd run service configuration screenshot image" /></a></p> <p>Make your choice and press <b>OK</b> to continue. You should get something like the example below when apt-get finished the installation: </p> <table><tr><td><code> * Starting ftp server proftpd [ OK ]<br /><br /> Setting up proftpd-mod-mysql (1.3.1-12ubuntu1) ...<br /> Setting up proftpd-mod-pgsql (1.3.1-12ubuntu1) ...<br /> Setting up proftpd-mod-ldap (1.3.1-12ubuntu1) ...<br /> Setting up proftpd (1.3.1-12ubuntu1) ...<br /> Processing triggers for libc6 ...<br /> ldconfig deferred processing now taking place<br /> luzar@ubuntu:~$<br /></code></td> </tr></table><h2><a name="configure-proftpd" id="configure-proftpd">Configure proftpd in Ubuntu server</a></h2> <p>Proftpd configuration file can be found in <b>/etc/proftpd/</b> directory. See the example below: </p> <table><tr><td><code>luzar@ubuntu:~$ <span style="color:red;">cd /etc/proftpd/</span><br /> luzar@ubuntu:/etc/proftpd$ ls -l<br /> total 24<br /> -rw-r--r-- 1 root root 665 2009-02-14 15:51 ldap.conf<br /> -rw-r--r-- 1 root root 1453 2009-02-14 15:51 modules.conf<br /><span style="color:blue;">-rw-r--r-- 1 root root 5046 2009-02-14 15:51 proftpd.conf</span><br /> -rw-r--r-- 1 root root 864 2009-02-14 15:51 sql.conf<br /> -rw-r--r-- 1 root root 1717 2009-02-14 15:51 tls.conf<br /> luzar@ubuntu:/etc/proftpd$<br /></code></td> </tr></table><p>The main configuration file is proftpd.conf file. You can see that proftpd includes configuration files for other modules that its support. Now let's configure the proftpd.conf file.</p> <p>As usual, good practice before we start editing any configuration file is to back up the original file. Here is the command to make a duplicate copy of proftpd.conf file:</p> <table><tr><td><code>luzar@ubuntu:/etc/proftpd$ <span style="color:red;">sudo cp proftpd.conf proftpd.conf.ori</span><br /> [sudo] password for luzar:<br /> luzar@ubuntu:/etc/proftpd$ ls<br /> ldap.conf modules.conf proftpd.conf <span style="color:blue;">proftpd.conf.ori</span> sql.conf tls.conf<br /> luzar@ubuntu:/etc/proftpd$<br /></code></td> </tr></table><p>Open proftpd.conf file with vim editor or whatever text editor that you are familiar with. You are going to activate, deactivate and change default configuration to match your ftp server needs.</p> <p>Before begin modifying proftpd.conf file, you should know the common format of proftpd.conf. Here is the basic format:</p> <ul><li>Syntax: [directive-name] [some arguments] </li> <li>Default: [directive-name] [default-value] </li> <li>Context: [context-list] such as &lt;VirtualHost&gt;, &lt;Global&gt;, &lt;Anonymous&gt;, &lt;Directory&gt;</li> <li>Module: module-name </li> <li>Compatibility: compatibility notes </li> </ul><p>A full directives list can be found in the proftpd user's guide, under <b>References</b> in proftpd official website. The description and usage of each directive is also explained in the manual. Here is the link:</p> <p><a href="http://www.proftpd.org/docs/directives/configuration_full.html" target="_blank">A list of all configuration directives.</a></p> <p>The proftpd.conf file is pre-configured and should be working by default when we start the daemon. However, the default configuration only allows Linux system users and block anonymous. The example below shows a basic ftp server configuration for a system users and anonymous. Remember, to activate a directive, just remove <b>#</b> at the beginning of the line. To deactivate a directive, add <b>#</b> at the beginning of the line. The modified directives and options are in red colored font. There is a simple explanation about each modification while the directives which has been marked <b>default configuration</b> is left with its original option.</p> <p>Default configuration.</p> <table><tr><td><code># /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.<br /> # To really apply changes reload proftpd after modifications.<br /> #<br /><br /> # Includes DSO modules<br /> Include /etc/proftpd/modules.conf </code></td> </tr></table><p>Perhaps you should consider this line if you only use ipv4: </p> <table><tr><td><code># Set off to disable IPv6 support which is annoying on IPv4 only boxes.<br /> UseIPv6 <span style="color:red;">off</span> </code></td> </tr></table><p>Default configuration.</p> <table><tr><td><code># If set on you can experience a longer connection delay in many cases.<br /> IdentLookups off </code></td> </tr></table><p>Change ServerName according to your server system. Change ServerType according to what you chose during proftpd installation, inetd or standalone: </p> <table><tr><td><code>ServerName <span style="color:red;">"Ubuntu"</span><br /> ServerType <span style="color:red;">standalone</span><br /> DeferWelcome off </code></td> </tr></table><p>Default configuration.</p> <table><tr><td><code>MultilineRFC2228 on<br /> DefaultServer on<br /> ShowSymlinks on<br /><br /> TimeoutNoTransfer 600<br /> TimeoutStalled 600<br /> TimeoutIdle 1200 </code></td> </tr></table><p>You can announce rules for ftp user by editing welcome.msg which is located in /home/ftp.</p> <table><tr><td><code>DisplayLogin welcome.msg </code></td> </tr></table><p>Default configuration.</p> <table><tr><td><code>DisplayChdir .message true<br /> ListOptions "-l"<br /><br /> DenyFilter \*.*/ </code></td> </tr></table><p>Uncomment this to restrict Ubuntu users to their own account home directory. That means Ubuntu users were prevented to navigate outside of their home directory. The term always used for this is <b>chroot jail</b>.</p> <table><tr><td><code># Use this to jail all users in their homes<br /> DefaultRoot ~<br /></code></td> </tr></table><p>Default configuration.</p> <table><tr><td><code># Users require a valid shell listed in /etc/shells to login.<br /> # Use this directive to release that constrain.<br /> # RequireValidShell off<br /></code></td> </tr></table><p>Port 21 is the standard FTP port. You can change the port to improve security.</p> <table><tr><td><code># Port 21 is the standard FTP port.<br /> Port 21<br /></code></td> </tr></table><p>Default configuration.</p> <table><tr><td><code># In some cases you have to specify passive ports range to by-pass<br /> # firewall limitations. Ephemeral ports can be used for that, but<br /> # feel free to use a more narrow range.<br /> # PassivePorts 49152 65534<br /><br /> # If your host was NATted, this option is useful in order to<br /> # allow passive tranfers to work. You have to use your public<br /> # address and opening the passive ports used on your firewall as well.<br /> # MasqueradeAddress 1.2.3.4<br /><br /> # This is useful for masquerading address with dynamic IPs:<br /> # refresh any configured MasqueradeAddress directives every 8 hours<br /> &lt;IfModule mod_dynmasq.c&gt;<br /> # DynMasqRefresh 28800<br /> &lt;/IfModule&gt;<br /><br /> # To prevent DoS attacks, set the maximum number of child processes<br /> # to 30. If you need to allow more than 30 concurrent connections<br /> # at once, simply increase this value. Note that this ONLY works<br /> # in standalone mode, in inetd mode you should use an inetd server<br /> # that allows you to limit maximum number of processes per service<br /> # (such as xinetd)<br /> MaxInstances 30 </code></td> </tr></table><p>Normally, when installing a server, a <b>nobody</b> user would be used by default. Proftpd, however, creates its own user and group to manages the daemon after switched by root during startup. That's ok already but if you have your reason to change the default user and group that manages proftpd, you can change it here: </p> <table><tr><td><code># Set the user and group that the server normally runs at.<br /> User proftpd<br /> Group nogroup<br /></code></td> </tr></table><p>The Umask format is <b>Umask [file permission] [directory permission]</b>. For example, Umask 133 for file permission means 644 equal to rw-r--r-- in normal file permission. While Umask 022 for directory permission means 755 equal to rwxr-xr-x in normal directory permission.</p> <table><tr><td><code># Umask 022 is a good standard umask to prevent new files and dirs<br /> # (second parm) from being group and world writable.<br /> Umask 022 022<br /></code></td> </tr></table><p>Default configuration.</p> <table><tr><td><code># Normally, we want files to be overwriteable.<br /> AllowOverwrite on<br /><br /> # Uncomment this if you are using NIS or LDAP via NSS to retrieve passwords:<br /> # PersistentPasswd off<br /><br /> # This is required to use both PAM-based authentication and local passwords<br /> # AuthOrder *mod_auth_pam.c mod_auth_unix.c<br /><br /> # Be warned: use of this directive impacts CPU average load!<br /> # Uncomment this if you like to see progress and transfer rate with ftpwho<br /> # in downloads. That is not needed for uploads rates.<br /> #<br /> # UseSendFile off<br /><br /> # Choose a SQL backend among MySQL or PostgreSQL.<br /> # Both modules are loaded in default configuration, so you have to<br /> # specify the backend<br /> # or comment out the unused module in /etc/proftpd/modules.conf.<br /> # Use 'mysql' or 'postgres' as possible values.<br /> #<br /> #&lt;IfModule mod_sql.c&gt;<br /> # SQLBackend mysql<br /> #&lt;/IfModule&gt;<br /></code></td> </tr></table><p>Proftpd creates log directory and files in default installation. Here is the location:</p> <table><tr><td><code>TransferLog /var/log/proftpd/xferlog<br /> SystemLog /var/log/proftpd/proftpd.log<br /></code></td> </tr></table><p>Default configuration.</p> <table><tr><td><code>&lt;IfModule mod_quotatab.c&gt;<br /> QuotaEngine off<br /> &lt;/IfModule&gt;<br /><br /> &lt;IfModule mod_ratio.c&gt;<br /> Ratios off<br /> &lt;/IfModule&gt;<br /><br /> # Delay engine reduces impact of the so-called Timing Attack described in<br /> # http://security.lss.hr/index.php?page=details&amp;ID=LSS-2004-10-02<br /> # It is on by default.<br /> &lt;IfModule mod_delay.c&gt;<br /> DelayEngine on<br /> &lt;/IfModule&gt;<br /><br /> &lt;IfModule mod_ctrls.c&gt;<br /> ControlsEngine off<br /> ControlsMaxClients 2<br /> ControlsLog /var/log/proftpd/controls.log<br /> ControlsInterval 5<br /> ControlsSocket /var/run/proftpd/proftpd.sock<br /> &lt;/IfModule&gt;<br /><br /> &lt;IfModule mod_ctrls_admin.c&gt;<br /> AdminControlsEngine off<br /> &lt;/IfModule&gt;<br /><br /> #<br /> # Alternative authentication frameworks<br /> #<br /> #Include /etc/proftpd/ldap.conf<br /> #Include /etc/proftpd/sql.conf<br /><br /> #<br /> # This is used for FTPS connections<br /> #<br /> #Include /etc/proftpd/tls.conf<br /></code></td> </tr></table><p>The section below is the proftpd configuration for anonymous user. We are going to allow anonymous access, so remove # at the beginning of the line to enable anonymous user directive configuration.</p> <table><tr><td><code># A basic anonymous configuration, no upload directories.<br /><span style="color:red;"><br /> # &lt;Anonymous ~ftp&gt;<br /> User ftp<br /> Group nogroup<br /></span><br /> # We want clients to be able to login with "anonymous" as well as "ftp"<br /><span style="color:red;">UserAlias anonymous ftp</span><br /> # Cosmetic changes, all files belongs to ftp user<br /><span style="color:red;"><br /> DirFakeUser on ftp<br /> DirFakeGroup on ftp<br /><br /> RequireValidShell off</span><br /> # Limit the maximum number of anonymous logins<br /><span style="color:red;">MaxClients 10</span><br /><br /> # We want 'welcome.msg' displayed at login, and '.message' displayed<br /> # in each newly chdired directory.<br /><span style="color:red;"><br /> DisplayLogin welcome.msg<br /> DisplayFirstChdir .message<br /></span><br /> # Limit WRITE everywhere in the anonymous chroot<br /><span style="color:red;"><br /> &lt;Directory *&gt;<br /> &lt;Limit WRITE&gt;<br /> DenyAll<br /> &lt;/Limit&gt;<br /> &lt;/Directory&gt;<br /></span><br /> # Uncomment this if you're brave.<br /> # &lt;Directory incoming&gt;<br /> # # Umask 022 is a good standard umask to prevent new files and dirs<br /> # # (second parm) from being group and world writable.<br /> # Umask 022 022<br /> # &lt;Limit READ WRITE&gt;<br /> # DenyAll<br /> # &lt;/Limit&gt;<br /> # &lt;Limit STOR&gt;<br /> # AllowAll<br /> # &lt;/Limit&gt;<br /> # &lt;/Directory&gt;<br /><br /> &lt;/Anonymous&gt;<br /> (END) </code></td> </tr></table><p>Save changes you made in proftpd and exit.</p> <h2><a name="restart-proftpd" id="restart-proftpd">Restart proftpd service</a></h2> <p>We need to restart the proftpd service to allow all changes we made to the configuration file to take effect. Restart proftpd service with this command: </p> <p><span style="color:red;">sudo /etc/init.d/proftpd restart</span></p> <p>Unfortunately proftpd cannot start and I got this error:</p> <table><tr><td><code>luzar@ubuntu:/home/ftp$ <span style="color:red;">sudo /etc/init.d/proftpd restart</span><br /> * Stopping ftp server proftpd [ OK ]<br /> * Starting ftp server proftpd<br /><span style="color:red;">- warning: the DisplayFirstChdir directive is deprecated and will be<br /> removed in a future release. Please use the DisplayChdir directive.<br /> - Fatal: &lt;Directory&gt;: relative path not allowed in non-&lt;Anonymous&gt;<br /> sections on line 161 of '/etc/proftpd/proftpd.conf'</span><br /><span style="color:red;">[fail]</span> </code></td> </tr></table><h2><a name="troubleshoot-proftpd" id="troubleshoot-proftpd">Troubleshooting tips for proftpd error</a></h2> <p>Proftpd works fine with default setting. If you got error after editing the proftpd.conf file, that means you leave a mistake in the configuration file. For example, I got the error above because I forgot to remove a comment (#) for anonymous configuration. So, open proftpd.conf again and fix the error: </p> <p><span style="color:red;">sudo vim +161 /etc/proftpd/proftpd.conf</span></p> <p>Remove # at the beginning of &lt;Anonymous ~ftp&gt; and change DisplayFirstChdir directive to DisplayChdir directive.</p> <table><tr><td><code><span style="color:red;">&lt;Anonymous ~ftp&gt;</span><br /> User ftp<br /> Group nogroup<br /> # We want clients to be able to login with "anonymous" as well as "ftp"<br /> UserAlias anonymous ftp<br /> # Cosmetic changes, all files belongs to ftp user<br /> DirFakeUser on ftp<br /> DirFakeGroup on ftp<br /><br /> RequireValidShell off<br /> # Limit the maximum number of anonymous logins<br /> MaxClients 10<br /><br /> # We want 'welcome.msg' displayed at login, and '.message' displayed<br /> # in each newly chdired directory.<br /> DisplayLogin welcome.msg<br /><span style="color:red;">DisplayChdir</span> .message<br /><br /> # Limit WRITE everywhere in the anonymous chroot<br /> &lt;Directory *&gt;<br /> &lt;Limit WRITE&gt;<br /> DenyAll<br /> &lt;/Limit&gt;<br /> &lt;/Directory&gt; </code></td> </tr></table><p>Restart proftpd daemon again:</p> <table><tr><td><code>luzar@ubuntu:/home/ftp$ <span style="color:red;">sudo /etc/init.d/proftpd restart</span><br /> * Stopping ftp server proftpd [ OK ]<br /> * Starting ftp server proftpd [ OK ]<br /> luzar@ubuntu:/home/ftp$<br /></code></td> </tr></table><p>Test login to proftpd FTP server with Ubuntu user and anonymous user:</p> <table><tr><td><code>luzar@hitam:~$ <span style="color:red;">ftp 172.16.153.129</span><br /> Connected to 172.16.153.129.<br /> 220 ProFTPD 1.3.1 Server (Ubuntu) [::ffff:172.16.153.129]<br /> Name (172.16.153.129:luzar):<br /> 331 Password required for luzar<br /> Password:<br /> 230 User luzar logged in<br /> Remote system type is UNIX.<br /> Using binary mode to transfer files.<br /> ftp&gt; <span style="color:red;">ls</span><br /> 200 PORT command successful<br /> 150 Opening ASCII mode data connection for file list<br /> -rw-r--r-- 1 luzar luzar 3903990 Jan 26 16:19 UserManual.pdf<br /> -rw-r--r-- 1 luzar luzar 376028 Feb 3 19:23 netfilter.pdf<br /> 226 Transfer complete </code></td> </tr></table><p>Let's try moving to two upper directory:</p> <table><tr><td><code>ftp&gt; <span style="color:red;">cd ../..</span><br /> 250 CWD command successful<br /> ftp&gt; ls<br /> 200 PORT command successful<br /> 150 Opening ASCII mode data connection for file list<br /> -rw-r--r-- 1 luzar luzar 3903990 Jan 26 16:19 UserManual.pdf<br /> -rw-r--r-- 1 luzar luzar 376028 Feb 3 19:23 netfilter.pdf<br /> 226 Transfer complete<br /> ftp&gt; <span style="color:red;">bye</span><br /> 221 Goodbye. </code></td> </tr></table><p>We can't move to the upper directory because chroot jail has been enabled. Let's try login to the ftp server as anonymous user:</p> <table><tr><td><code>luzar@hitam:~$ <span style="color:red;">ftp 172.16.153.129</span><br /> Connected to 172.16.153.129.<br /> 220 ProFTPD 1.3.1 Server (Ubuntu) [::ffff:172.16.153.129]<br /> Name (172.16.153.129:luzar): <span style="color:red;">anonymous</span><br /> 331 Anonymous login ok, send your complete email address as your password<br /> Password:<br /> 230-Welcome, archive user anonymous@::ffff:172.16.153.1 !<br /> 230-<br /> 230-The local time is: Sun Feb 15 10:17:03 2009<br /> 230-<br /> 230-This is an additional FTP server. You only have permission<br /> 230-to download files. If you have any unusual problems,<br /> 230-please report them via e-mail to <root>.<br /> 230-<br /> 230 Anonymous access granted, restrictions apply<br /> Remote system type is UNIX.<br /> Using binary mode to transfer files.<br /> ftp&gt; <span style="color:red;">ls</span><br /> 200 PORT command successful<br /> 150 Opening ASCII mode data connection for file list<br /> -rw-r--r-- 1 ftp ftp 170 Aug 16 2008 welcome.msg<br /> 226 Transfer complete </root></code></td> </tr></table><p>Let's try moving to two upper directory:</p> <table><tr><td><code>ftp&gt; <span style="color:red;">cd ../..</span><br /> 250 CWD command successful<br /> ftp&gt; ls<br /> 200 PORT command successful<br /> 150 Opening ASCII mode data connection for file list<br /> -rw-r--r-- 1 ftp ftp 170 Aug 16 2008 welcome.msg<br /> 226 Transfer complete<br /> ftp&gt; </code></td> </tr></table><p>Great, anonymous user also cannot move to the upper directory. So that probably covers some basic security in proftpd configuration for local used. This configuration however is not recommended for external used because of the security reason.</p> <p>Other options to make proftpd more secure is to block system users login to the ftp server. Proftpd includes many authentication modules such as ldap, sql and AuthUserFile which is a virtual user account. If you haven't had ldap setup, then setup AuthUserFile is a good choice. It is easy and we can do this straight away.</p> <h2><a name="authuserfile-proftpd" id="authuserfile-proftpd">Setup AuthUserFile for proftpd authentication</a></h2> <p>AuthUserFile uses a virtual user account to authenticate login into the proftpd ftp server. To create virtual user account, we can use <b>ftpasswd</b> tool, which is a perl script included with proftpd package. Ftpasswd installed by default during proftpd installation. So we can use it right away.</p> <p>If we invoke <b>man ftpasswd</b>, we can see that ftpasswd manipulates proftpd authentication files. Ftpasswd creates AuthUserFile and AuthGroupFile, which contains virtual user accounts information to allow them access ftp server. </p> <p>We are going to create AuthUserFile and AuthGroupFile in /etc/proftpd directory. Change directory to /etc/proftpd and run ftpasswd. Below is ftpasswd example used to create a user account. The format is the same as you can see in the ftpasswd manual page:</p> <table><tr><td><code>luzar@ubuntu:/etc/proftpd$ <span style="color:red;">sudo ftpasswd --passwd --name=labu <br />--uid=1010 --home=/home/ftp --shell=/bin/false</span><br /> ftpasswd: --passwd: missing --gid argument: default gid set to uid<br /> ftpasswd: creating passwd entry for user labu<br /><br /> ftpasswd: /bin/false is not among the valid system shells. Use of<br /> ftpasswd: "RequireValidShell off" may be required, and the PAM<br /> ftpasswd: module configuration may need to be adjusted.<br /><br /> Password:<span style="color:red;">Enter password</span><br /> Re-type password:<span style="color:red;">Re-enter password</span><br /><br /> ftpasswd: entry created </code></td> </tr></table><p>We've got two warning there, the first paragraph is gid and the second paragraph concerns proftpd.conf file. Let's fix the first warning first and the proftpd warning later. So this time we create a second user with gid included:</p> <table><tr><td><code>luzar@ubuntu:/etc/proftpd$ <span style="color:red;">sudo ftpasswd --passwd --name=aura --uid=1011 <br />--gid=1010 --home=/home/ftp --shell=/bin/false</span><br /> ftpasswd: creating passwd entry for user aura<br /><br /> ftpasswd: /bin/false is not among the valid system shells. Use of<br /> ftpasswd: "RequireValidShell off" may be required, and the PAM<br /> ftpasswd: module configuration may need to be adjusted.<br /><br /> Password:<span style="color:red;">Enter password</span><br /> Re-type password:<span style="color:red;">Re-enter password</span><br /><br /> ftpasswd: entry created </code></td> </tr></table><p>The <b>ftpasswd --passwd</b> option creates username entry in <b>ftpd.passwd</b> file. The ftpd.passwd format is the same as /etc/passwd system file. Here is the format:</p> <p><span style="color:red;">username:password:uid:gid:gecos:homedir:shell</span></p> <table><tr><td><code>luzar@ubuntu:/etc/proftpd$ <span style="color:red;">cat ftpd.passwd</span><br /> labu:$1$PtmsJf5A$R2vNdkSrVl9de.:1010:1010::/home/ftp:/bin/false<br /> aura:$1$svlH3xco$tLhC/J97iBB2h:1011:1010::/home/aura:/bin/false </code></td> </tr></table><p>This is how to create AuthGroupFile:</p> <table><tr><td><code>luzar@ubuntu:/etc/proftpd$ <span style="color:red;">sudo ftpasswd --group --name=ftpd <br />--gid=1010 --member=labu --member=aura</span><br /> ftpasswd: updating group entry for group ftpd<br /> ftpasswd: entry updated </code></td> </tr></table><p>The <b>ftpasswd --group</b> option creates a group entry in <b>ftpd.group</b> file. The format is the same as /etc/group file.</p> <table><tr><td><code>luzar@ubuntu:/etc/proftpd$ <span style="color:red;">cat ftpd.group</span><br /> ftpd:x:1010:labu,aura </code></td> </tr></table><p>Now we need to add AuthUserFile in /etc/proftpd/proftpd.conf file. Use text editor and open the file:</p> <table><tr><td><code>luzar@ubuntu:/etc/proftpd$ <span style="color:red;">sudo vim proftpd.conf</span> </code></td> </tr></table><p>Add these lines:</p> <table><tr><td><code># Authentication using AuthUserFile<br /><span style="color:red;">AuthUserFile /etc/proftpd/ftpd.passwd</span><br /><br /> # AuthOrder to use mod_auth_file.c only, no local user allowed<br /><span style="color:red;">AuthOrder mod_auth_file.c</span> </code></td> </tr></table><p>Save and exit. Restart proftpd daemon:</p> <table><tr><td><code>luzar@ubuntu:/etc/proftpd$ <span style="color:red;">sudo /etc/init.d/proftpd restart</span><br /> * Stopping ftp server proftpd [ OK ]<br /> * Starting ftp server proftpd [ OK ] </code></td> </tr></table><p>Test login to the ftp server with AuthUserFile:</p> <table><tr><td><code>luzar@hitam:~$ <span style="color:red;">ftp 172.16.153.129</span><br /> Connected to 172.16.153.129.<br /> 220 ProFTPD 1.3.1 Server (Ubuntu FTP server) [172.16.153.129]<br /> Name (172.16.153.129:luzar): labu<br /> 331 Password required for labu<br /> Password:<br /> 230-Welcome, archive user labu@172.16.153.1 !<br /> 230-<br /> 230-The local time is: Mon Feb 16 16:06:04 2009<br /> 230-<br /> 230-This is an additional FTP server. You only have permission<br /> 230-to download files. If you have any unusual problems,<br /> 230-please report them via e-mail to <root>.<br /> 230-<br /> 230 User labu logged in<br /> Remote system type is UNIX.<br /> Using binary mode to transfer files.<br /> ftp&gt; bye<br /> 221 Goodbye.<br /> luzar@hitam:~$ </root></code></td> </tr></table><p>Test login to the ftp server with local user account:</p> <table><tr><td><code> luzar@hitam:~$ <span style="color:red;">ftp 172.16.153.129</span><br /> Connected to 172.16.153.129.<br /> 220 ProFTPD 1.3.1 Server (Ubuntu FTP server) [172.16.153.129]<br /> Name (172.16.153.129:luzar):<br /> 331 Password required for luzar<br /> Password:<br /> 530 Login incorrect.<br /> Login failed.<br /> Remote system type is UNIX.<br /> Using binary mode to transfer files.<br /> ftp&gt; </code></td> </tr></table><p>That's all. Good luck configuring your proftp server.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/15" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux ftp</a></div><div class="field-item odd" rel="dc:subject"><a href="/taxonomy/term/16" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux server</a></div></div></div> Sat, 14 Feb 2009 20:52:58 +0000 jinlusuh 119 at http://basicconfig.com http://basicconfig.com/linuxnetwork/install_configure_proftpd_ubuntu_server#comments Setup Linux ftp server - Install and configure vsftpd in Slackware http://basicconfig.com/linuxnetwork/ftp_server <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>FTP is an Internet file transfer protocol. It's used widely to transfer data between the Internet, WAN and LAN network around the world. In Slackware Linux, ftp server and ftp client are included in default installation. Proftpd is a default ftp server in Slackware for many years but starting from version 10.2, Slackware ships vsftpd in the official packages as well. In this tutorial, we'll learn how to setup vsftpd as ftp server in Slackware Linux and configure vsftpd.conf file to customize ftp server to our needs.</p> <p>If you are using other Linux distribution, you can also use this tutorial as a guide. The vsftpd ftp server package comes with Fedora and other major distributions too but if you can't find it in your Linux, you can download the package from your Linux distribution's website or source from the <a href="http://vsftpd.beasts.org" target="_blank">vsftpd official website.</a></p> <p>This tutorial is a beginner's guide on how to setup vsftpd ftp server in Slackware Linux. The tutorial covers:</p> <ul><li><a href="#check-vsftpd">Check vsftpd in Slackware Linux</a></li> <li><a href="#install-vsftpd">Install vsftpd in Slackware Linux</a></li> <li><a href="#config-vsftpd">Configure vsftpd as Slackware ftp server</a></li> <li><a href="#restart-vsftpd">Restart vsftpd ftp server</a></li> <li><a href="#test-vsftpd">Test vsftpd ftp server</a></li> </ul><h2><a name="check-vsftpd" id="check-vsftpd">Check vsftpd in Slackware Linux</a></h2> <p>Firstly, we need to check vsftpd package in our Linux system. Normally we can use Linux package management system to check installed package and use Linux ps command to verify the running service. We can also check log for installed packages. In Slackware Linux, we can use <em>pkgtool</em> to check whether vsftpd has been installed or not. See example below:</p> <p>Open Linux terminal and type pkgtool and press enter.</p> <table><tr><td><a href="mailto:root@slackware">root@slackware</a>:~# <span style="color:red;">pkgtool</span> </td> </tr></table><p>Use arrow down key and choose View option to view the list of files in a package.</p> <p><a href="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/ftp_server01.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/thumbs/ftp_server01.png" alt="pkgtool interface chose view option screenshot" /></a></p> <p>Press v key to go the package name start with v. Press arrow key and search for vsftpd.</p> <p><a href="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/ftp_server02.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/thumbs/ftp_server02.png" alt="pkgtool interface view vsftpd screenshot" /></a></p> <p>Press enter to read information about vsftpd package. The Very Secure FTP Daemon was written by Chris Evans.</p> <p><a href="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/ftp_server03.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/thumbs/ftp_server03.png" alt="pkgtool interface vsftpd view package screenshot" /></a></p> <p>Press Tab key to move cursor to the Cancel button. Enter to exit.</p> <p><a href="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/ftp_server04.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/thumbs/ftp_server04.png" alt="pkgtool interface exit vsftpd screenshot" /></a></p> <p>Press Tab key again to move cursor to the Cancel button. Enter to exit.</p> <p><a href="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/ftp_server05.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/thumbs/ftp_server05.png" alt="Exit pkgtool interface screenshot" /></a></p> <p>You can also check vsftpd package in <em>/var/log/packages</em>:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">ls /var/log/packages/ | grep vsftpd</span><br /> vsftpd-2.0.7-i486-1<br /> root@slackware:~#<br /></code></td> </tr></table><p>We can see that vsftpd is already installed in my Slackware. Don't worry, here is a guide on how to install vsftpd in Slackware in case yours is not installed:</p> <h2><a name="install-vsftpd" id="install-vsftpd">Install vsftpd in Slackware Linux</a></h2> <p>The less hassle way to install vsftpd in Slackware Linux is using <em>slackpkg</em>. However, you need to install and configure slackpkg before you can use it because slackpkg is not installed by default. You also need an Internet connection. See <a href="/linux/slackpkg" target="_blank">Slackware package management system</a> on how to use slackpkg. To install vsftpd using slackpkg, invoke the command below:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">slackpkg install vsftpd</span><br /></code></td> </tr></table><p>The easiest way is to use pkgtool and install vsftpd from Slackware dvd installer. You have to mount Slackware dvd installer before issuing the pkgtool command. In the pkgtool main menu, choose to <b>install from other directory</b> and provide the path of the mounted Slackware dvd installer.</p> <p>If you don't have the installer, then the final choice would be downloding vsftpd package from Slackware packages website: <a href="http://packages.slackware.it" target="_blank">Slackware packages</a>. Then use installpkg command: <b>installpkg [-m] packagename</b> to install vsftpd.</p> <h2><a name="config-vsftpd" id="config-vsftpd">Configure vsftpd as Slackware ftp server</a></h2> <p>vsftpd stands for <i>very secure file transfer program daemon</i>. It's secure, light and the most popular ftp server at the moment. To configure vsftpd server, let's take a look at the configuration file, vsftpd.conf. Issue <b>vim /etc/vsftpd.conf</b> command to open the configuration file with vim text editor and edit to suite your need (of course you can use any text editor that you prefer).</p> <table><tr><td><code> root@slackware:~$ <span style="color:red;">vim /etc/vsftpd.conf </span><br /></code></td> </tr></table><p><em>Note: You must have root privilege to edit and save the file. If you login as a normal user, use 'su -' command and enter root password.</em></p> <p>This script is straight forward. There shouldn't be any problem to understand the script even for a first time user. Remove comment (remove #) to allow any rules and options.</p> <p><a href="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/ftp_server06.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/thumbs/ftp_server06.png" alt="activate vsftpd server" /></a></p> <table><tr><td><code>#<br /> # You may specify a file of disallowed anonymous e-mail addresses. Apparently<br /> # useful for combatting certain DoS attacks.<br /> #deny_email_enable=YES<br /> # (default follows)<br /> #banned_email_file=/etc/vsftpd.banned_emails<br /> #<br /> # You may specify an explicit list of local users to chroot() to their home<br /> # directory. If chroot_local_user is YES, then this list becomes a list of<br /> # users to NOT chroot().<br /> #chroot_list_enable=YES<br /> # (default follows)<br /> #chroot_list_file=/etc/vsftpd.chroot_list<br /> #<br /> # You may activate the "-R" option to the builtin ls. This is disabled by<br /> # default to avoid remote users being able to cause excessive I/O on large<br /> # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume<br /> # the presence of the "-R" option, so there is a strong case for enabling it.<br /> ls_recurse_enable=YES<br /> #<br /> # To run vsftpd in standalone mode (rather than through inetd), uncomment<br /> # the line below.<br /> #listen=YES<br /></code></td> </tr></table><p>Now we must activate vsftpd daemon to start using our ftp server. In slackware, we can do this by editing the super server, inetd.conf. Type vim /etc/inetd.conf and remove comment at the beginning of vsftpd line:</p> <table><tr><td><code> # Very Secure File Transfer Protocol (FTP) server.<br /> ftp stream tcp nowait root /usr/sbin/tcpd vsftpd</code></td> </tr></table><p>Enter :wq! to save the vsftpd.conf file and exit vim editor.</p> <h2><a name="restart-vsftpd" id="restart-vsftpd">Restart vsftpd ftp server</a></h2> <p>Now we can restart vsftpd service so that the new configuration take effect. If you are using the default Slackware vsftpd configuration as in the example above, you can restart inetd with the command below:</p> <table><tr><td><code> root@slackware:~$<br /> root@slackware:~$ <span style="color:red;">/etc/rc.d/rc.inetd restart </span><br /></code></td> </tr></table><p>The inetd super server starts automatically during Slackware booting. If you need to start inetd manually, you can use the same command as above and replace 'restart' with 'start'. See example below:</p> <table><tr><td><code> root@slackware:~$<br /> root@slackware:~$ <span style="color:red;">/etc/rc.d/rc.inetd start </span><br /></code></td> </tr></table><h2><a name="test-vsftpd" id="test-vsftpd">Test vsftpd ftp server</a></h2> <p>To test our new ftp server, open a new terminal and login as a normal user. Login to the ftp server by typing <b>ftp</b> at the command prompt. See an example below:</p> <table><tr><td><code>luzar@slackware:~$ <span style="color:red;">ftp</span><br /> ftp&gt; <span style="color:red;">open</span><br /> (to) <span style="color:red;">example.org</span><br /> Connected to example.org.<br /></code></td> </tr></table><p>If you can connect to the ftp server, that means you successfully setup vsfpd ftp server in Slackware Linux. Depends on how you configure vsftpd.conf file, you must provide username, whether it's local user account or anonymous. You can find more about ftp client commands at <a href="/linux/ftp">Linux ftp tutorial - FTP client guides</a>.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/15" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux ftp</a></div><div class="field-item odd" rel="dc:subject"><a href="/taxonomy/term/16" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux server</a></div></div></div> Wed, 10 Sep 2008 16:29:25 +0000 jinlusuh 117 at http://basicconfig.com http://basicconfig.com/linuxnetwork/ftp_server#comments Linux ftp tutorial - ftp client guides http://basicconfig.com/linux/ftp <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><h2>What is FTP?</h2> <p>FTP stands for <em>file transfer protocol</em>. It is widely used as file transfer protocol in the Internet and file sharing in local networks such as in university, business and organizations around the world. Basically, ftp allows data sharing in a networking environment. It is a client-server concept, where an ftp server serves all clients in the network.</p> <p>Although we can send and receive file using email attachment, but the fact that email only allows small size attachment has made ftp a popular protocol to transfer files. In Linux environment, ftp is very important because many task and application use ftp protocol such as Linux package management system. Another example of ftp important usage is transfering large web site files to the web server.</p> <p>A standard ftp port is port 21. You can check ftp port using telnet command to make sure it's open or not. The command syntax is <em>telnet domain-name 21</em>. You can also use ip address and replace domain-name. Here is the example on how to check ftp port 21 using telnet command:</p> <table><tr><td><code>luzar@slackware:~$ <span style="color:#FF0000;">telnet slackware.example.com 21</span><br /> Trying 192.168.0.3...<br /> Connected to slackware.example.com.<br /> Escape character is '^]'.<br /> 220---------- Welcome to Pure-FTPd [TLS] ----------<br /> 220-You are user number 2 of 50 allowed.<br /> 220-Local time is now 21:35. Server port: 21.<br /> 220-This is a private system - No anonymous login<br /> 220-IPv6 connections are also welcome on this server.<br /> 220 You will be disconnected after 15 minutes of inactivity.<br /> quit<br /> 221-Goodbye. You uploaded 0 and downloaded 0 kbytes.<br /> 221 Logout.<br /></code></td> </tr></table><p>The example shows the server port 21 is open and not blocked by firewall. When using telnet command to check ftp port, we use 'quit' commmand to exit from telnet. To download files and upload files to the ftp server, we are going to use a proper ftp client.</p> <h2>Linux ftp client</h2> <p>If you are using Slackware Linux, you can use <b>gftp</b>, which is a gui ftp client program comes by default installation in KDE. If you are using Ubuntu desktop, you can also install gftp in gnome. Here is gftp program information:</p> <table><tr><td><code>gFTP is a multithreaded FTP client. This version of it runs under X and was written using GLib/GTK+.<br /> gFTP features:<br /> * simultaneous downloads,<br /> * resuming of interrupted file transfers,<br /> * file transfer queues,<br /> * downloading of entire directories,<br /> * FTP and HTTP proxy support,<br /> * remote directory caching,<br /> * passive and non-passive file transfers,<br /> * drag-n-drop support,<br /> * bookmarks menu,<br /> * support for SSH and SSH2 file transfers,<br /> * support FXP transfers,<br /> * stop button, and many more features.<br /> Author: Brian Masney <masneyb><br /><br /> Homepage: http://www.gftp.org/<br /></masneyb></code></td> </tr></table><p>There are other free ftp client programs that you can install in Linux such as:</p> <h3>Java GUI client for FTP, SMB, SFTP and NFS </h3> <p>JFtp is a graphical Java network and file transfer client. It supports FTP using its own FTP API and various other protocols like SMB, SFTP, NFS, HTTP, and file I/O using third party APIs. It includes many advanced features such as recursive directory up/download, browsing FTP servers while transferring files, FTP resuming and queueing, browsing the LAN for Windows shares, and more. Multiple connections can open at a time in a Mozilla-style tabbed browsing environment.</p> <p>Homepage: <a href="http://j-ftp.sourceforge.net">http://j-ftp.sourceforge.net</a></p> <h3>KFTPGrabber ftp client for KDE</h3> <table><tr><td><code>KFTPgrabber is a graphical FTP client for the K Desktop Environment. It implements many features required for usable FTP interaction.<br /> Feature list:<br /> * Multiple simultaneous FTP sessions in separate tabs<br /> * A tree-oriented transfer queue<br /> * TLS/SSL support for the control connection and the data channel<br /> * X509 certificate support for authentication<br /> * FXP site-to-site transfer support<br /> * One-time password (OTP) support using S/KEY, MD5, RMD160 or SHA1<br /> * Site bookmarks with many options configurable per-site<br /> * Distributed FTP daemon support (implementing the PRET command)<br /> * Can use Zeroconf for local site discovery<br /> * Bookmark import plugins from other FTP clients<br /> * Support for the SFTP protocol<br /> * A nice traffic graph<br /> * Ability to limit upload and download speed<br /> * Priority and skip lists<br /> * Integrated SFV checksum verifier<br /> * Direct viewing/editing of remote files<br /> * Advanced default "on file exists" action configuration<br /> * Filter displayed files/directories as you type<br /><br /> Homepage: http://www.kftp.org<br /></code></td> </tr></table><h3>FileZilla ftp client</h3> <table><tr><td><code>FileZilla is a fast and reliable FTP client for Windows with lots of useful features and an intuitive interface.<br /> It's now multi-platform.<br /> This package contains localization for FileZilla. More than 40 languages are available.<br /><br /> Homepage: http://filezilla-project.org/<br /></code></td> </tr></table><h2>FTP client how to</h2> <p>This is a basic ftp client guide tutorial. You will learn how to use ftp client from command line terminal and using graphical user interface ftp client program. In command line terminal ftp client guide, you will learn ftp command to connect to the ftp server, download and upload files to the ftp server. It doesn't matter if you use Linux or Windows operating system, ftp is a standard network protocol. The basic ftp commands should be the same.</p> <h3>How to use ftp commands</h3> <p>Most Linux distributions come with ftp client by default. If your Linux doesn't have one, you can always use ftp client from the command line terminal. Just type 'ftp' without any option and enter. You can also use ftp client from Windows command prompt. The procedure is the same as using ftp from Linux command line terminal.</p> <p>Example running ftp client from windows operating system (Click Start --&gt; Run --&gt; cmd):</p> <table><tr><td><code> Microsoft Windows XP [Version 5.1.2600]<br /> C) Copyright 1985-2001 Microsoft Corp.<br /> C:\Documents and Settings\bill&gt; <span style="color:#FF0000;">ftp </span><br /> ftp&gt;<br /></code></td> </tr></table><p>Let's see what commands do we have in ftp program. Type 'help' at the ftp prompt and press 'Enter':</p> <table><tr><td><code>ftp&gt; <span style="color:#FF0000;">help </span><br /> Commands may be abbreviated. Commands are:<br /> ! delete literal prompt send<br /> ? debug ls put status<br /> append dir mdelete pwd trace<br /> ascii disconnect mdir quit type<br /> bell get mget quote user<br /> binary glob mkdir recv verbose<br /> bye hash mls remotehelp<br /> cd help mput rename<br /> close lcd open rmdir<br /></code></td> </tr></table><p>We want to establish a connection with the ftp server. The correct ftp command to use is the <b>open</b> command. Type <em>open</em> and press Enter. You need to provide the ftp server's ip address:</p> <table><tr><td><code> ftp&gt; <span style="color:#FF0000;">open</span><br /> To <span style="color:#FF0000;">192.168.0.5</span><br /> Connected to 192.168.0.5.<br /> 220 Microsoft FTP Service<br /> User (192.168.0.5:(none)): ftpuser<br /> 331 Password required for ftpuser.<br /> Password:<br /> 230 User ftpuser logged in.<br /> ftp&gt;<br /></code></td> </tr></table><p>Here are examples using ftp client from Linux command line terminal. To run the ftp client, type 'ftp' at the command prompt and press 'Enter':</p> <table><tr><td><code> bill@slackware:~$ <span style="color:#FF0000;">ftp</span><br /></code></td> </tr></table><p>To open connection with ftp server, use ftp command 'open' and provide ftp server domain name or ip address:</p> <table><tr><td><code> ftp&gt; <span style="color:#FF0000;">open</span><br /> (to) <span style="color:#FF0000;">ftp.example.com</span><br /> Connected to ftp.example.com.<br /> 220---------- Welcome to Pure-FTPd [TLS] ----------<br /> 220-You are user number 1 of 50 allowed.<br /> 220-Local time is now 18:18. Server port: 21.<br /> 220-This is a private system - No anonymous login<br /> 220-IPv6 connections are also welcome on this server.<br /> 220 You will be disconnected after 15 minutes of inactivity.<br /> Name (ftp.example.com:bill): bill[@]example.com<br /> 331 User bill[@]example.com OK. Password required<br /> Password:<br /> 230-User bill[@]example.com has group access to: bill<br /> 230-OK. Current restricted directory is /<br /> 230 0 Kbytes used (0%) - authorized: 2048000 Kb<br /> Remote system type is UNIX.<br /> Using binary mode to transfer files.<br /> ftp&gt;<br /></code></td> </tr></table><p>As we can see from the example above, we use ftp server domain name instead of ftp server's ip address. This is useful since it's easier to remember domain name rather than ip address.</p> <p>Here is another tips. We can also provide ftp server ip address when invoking ftp command. This will skip the ftp 'open' command. See the example below on how to do this:</p> <table><tr><td><code>luzar@slackware:~$ <span style="color:red;">ftp 172.16.153.129 </span><br /> Connected to 172.16.153.129.<br /> 220 ProFTPD 1.3.1 Server (Ubuntu FTP server) [172.16.153.129]<br /> Name (172.16.153.129:luzar): labu<br /> 331 Password required for labu<br /> Password:<br /> 230-Welcome, archive user labu@172.16.153.1 !<br /> 230-<br /> 230-The local time is: Sat Feb 21 18:26:53 2009<br /> 230-<br /> 230-This is an additional FTP server. You only have permission<br /> 230-to download files. If you have any unusual problems,<br /> 230-please report them via e-mail to root@ubuntu.localdomain.<br /> 230-<br /> 230 User labu logged in<br /> Remote system type is UNIX.<br /> Using binary mode to transfer files.<br /> ftp&gt;<br /></code></td> </tr></table><h3>Ftp upload how to</h3> <p>Now we are connected to the ftp server. It doesn't matter if we use Linux or windows because once the connection established, all the commands are the same. We use ftp supported commands and you can view them all by issuing <b>help</b> at the ftp prompt. For example, try <em>help mput</em>:</p> <table><tr><td><code> ftp&gt; <span style="color:#FF0000;">help mput </span><br /> mput send multiple files<br /></code></td> </tr></table><p>The ftp mput command can be used to send multiple files to the ftp server. That means if we have permission to upload files to ftp server, we can send multiple files using ftp mput command. Let's see an example on how ftp upload works:</p> <table><tr><td><code> ftp&gt; <span style="color:#FF0000;">lcd </span><br /> Local directory now /home/bill<br /> ftp&gt; <span style="color:#FF0000;">mput perlintro.txt </span><br /> mput perlintro.txt? <span style="color:#FF0000;">y </span><br /> 200 PORT command successful<br /> 150 Connecting to port 50861<br /> 226-24 Kbytes used (0%) - authorized: 2048000 Kb<br /> 226-File successfully transferred<br /> 226 0.406 seconds (measured here), 59.28 Kbytes per second<br /> 24653 bytes sent in 0.134 secs (1.8e+02 Kbytes/sec)<br /></code></td> </tr></table><p>What I did (command in red) above are <b>lcd</b> command to check my 'local directory' (client computer), then I used <b>mput</b> command to upload <em>perlintro.txt</em> file to the ftp server. To confirm the ftp upload, enter <em>y</em>.</p> <p>The ftp command mput also can be used to transfer a single file. However, the correct ftp command to send a single file is the <b>put</b> command.</p> <table><tr><td><code>ftp&gt; <span style="color:#FF0000;">help put </span><br /><span style="color:blue;">put send one file </span><br /> ftp&gt;<br /></code></td> </tr></table><h3>Ftp download how to</h3> <p>Here is a guide on how to download files from ftp server. Use ftp command <b>mget</b> to download files from ftp server.</p> <table><tr><td><code> ftp&gt; <span style="color:#FF0000;">help mget </span><br /><span style="color:blue;">mget get multiple files </span><br /></code></td> </tr></table><p>Here is an example on how to use ftp mget command to download files from ftp server:</p> <table><tr><td><code> ftp&gt; <span style="color:#FF0000;">mget perlintro.txt </span><br /> mget perlintro.txt? <span style="color:#FF0000;">y </span><br /> 200 PORT command successful<br /> 150-Connecting to port 29807<br /> 150 24.1 kbytes to download<br /> 226-File successfully transferred<br /> 226 0.000 seconds (measured here), 510.94 Mbytes per second<br /> 24653 bytes received in 1.07 secs (22 Kbytes/sec)<br /></code></td> </tr></table><p>The ftp command <b>mget</b> normally used to download multiple files from ftp server, but in our example, it is used to download a single file. The right ftp command to download a single file is the <b>get</b> command. You probably noticed, why did I mention this? Because some ftp server did not accept <b>get</b> command, so you can use <b>mget</b> if you happened to encounter one.</p> <p>To exit from ftp server, type <b>bye</b> and press enter.</p> <h2>Graphical user interface (GUI) ftp client</h2> <p>If you are a Linux desktop user and prefer using graphical user interface ftp client program from kde or gnome, here are step by step screenshot examples on how to use <b>gftp</b> ftp client to download and upload files:</p> <p>Click <b>Remote</b> and choose <b>Open location</b> </p> <p><a href="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/ftp_client_screenshot01.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/thumbs/ftp_client_screenshot01.png" alt="Open location gui ftp client screenshot image" /></a></p> <p>Enter domain name or ip address of the ftp server:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/ftp_client_screenshot02.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/thumbs/ftp_client_screenshot02.png" alt="Enter ftp server address gui ftp client screenshot image" /></a></p> <p>Enter username or user account to connect to the ftp server:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/ftp_client_screenshot03.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/thumbs/ftp_client_screenshot03.png" alt="Enter user name gui ftp client screenshot image" /></a></p> <p>Enter password for user account to connect to the ftp server:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/ftp_client_screenshot04.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/thumbs/ftp_client_screenshot04.png" alt="Enter password for ftp server gui ftp client screenshot image" /></a></p> <p>If your username valid and your password is correct, you should be successfully login into the ftp server. In <b>gftp</b>, click on the file or directory in the local directory and click upload arrow icon to transfer file to the ftp server. If you want to download file or directory, click on the file or directory in the ftp server, and click download arrow. See screenshot image below for example:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/ftp_client_screenshot05.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/thumbs/ftp_client_screenshot05.png" alt="Download file from ftp server gui ftp client screenshot image" /></a></p> <p>All gui ftp client program works almost the same. If you are using other gui ftp client, and there is no download/upload arrow icon, maybe you can right-click on the file or folder you are going to transfer and see if there are download/upload options available. If not, the transfer menu should be available in your ftp client so that you can upload and download files to the server.</p> <p>That's all you need to know about Linux ftp client. If you are looking for ftp server setup tutorial, you can find it in <a href="/linuxnetwork/ftp_server" target="_blank">Linux network - Install and configure vsftpd in Slackware Linux</a> for Slackware ftp server and <a href="/linuxnetwork/install_configure_proftpd_ubuntu_server" target="_blank">Linux network - Install and configure proftpd in Ubuntu Server</a> for Ubuntu ftp server. Good luck!</p> <p>Back to <a href="/linuxnetwork">Linux network command</a> tutorial page.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/15" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux ftp</a></div></div></div> Fri, 01 Feb 2008 12:58:10 +0000 jinlusuh 114 at http://basicconfig.com http://basicconfig.com/linux/ftp#comments