{"id":2052,"date":"2015-08-19T00:15:21","date_gmt":"2015-08-18T16:15:21","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=2052"},"modified":"2023-04-28T09:47:10","modified_gmt":"2023-04-28T09:47:10","slug":"how-to-configure-ftp-server-in-linux","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-configure-ftp-server-in-linux\/","title":{"rendered":"How to Configure FTP Server in Linux RHEL 6"},"content":{"rendered":"<p>In this post i will show how to install Very Secure FTP (Vsftpd) and how to configure ftp server in linux\u00a0Red Hat Enterprise Linux 6 (RHEL 6). Vsftpd is a GPL licensed <a href=\"https:\/\/en.wikipedia.org\/wiki\/File_Transfer_Protocol\" target=\"_blank\" rel=\"noopener\">FTP <\/a>server for UNIX systems, including Linux. It is secure and extremely fast and it is stable.<\/p>\n<p>As an example I will install and configure the vsftpd server and will also transfer files from the clients running on the Windows XP command prompt.<\/p>\n<p>-A linux server with ip address 192.168.1.43 running on RHEL 6 Operating system<br \/>\n-A window client with ip address 192.168.1.52 running on Windows XP Pro<br \/>\n-RHEL 6 server Running portmap\/rpcbind and xinetd services<br \/>\n-Firewall and SElinux should be off on server<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-6421 size-full lazyload\" data-src=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/08\/howtolinux-linux-ftp.png\" alt=\"how to configure ftp server in linux\" width=\"900\" height=\"513\" data-srcset=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/08\/howtolinux-linux-ftp.png 900w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/08\/howtolinux-linux-ftp-300x171.png 300w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/08\/howtolinux-linux-ftp-768x438.png 768w\" data-sizes=\"(max-width: 900px) 100vw, 900px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 900px; --smush-placeholder-aspect-ratio: 900\/513;\" \/><\/p>\n<h2>How to Install FTP Server in Linux ?<\/h2>\n<p>1. Install vsftpd, rpcbind and xinetd service using the following command :<\/p>\n<pre class=\"code\"># yum install vsftpd rpcbind xinetd -y\n<\/pre>\n<p>2. Check vsftpd, xinetd and rpcbind\/portmap exist and installed on the server :<\/p>\n<pre class=\"code\"># rpm -qa vsftpd\nvsftpd-2.2.2-6.el6.i686\n\n# rpm -qa xinetd\nxinetd-2.3.14-29.el6.i686\n\n# rpm -qa rpcbind\nrpcbind-0.2.0-8.el6.i686\n<\/pre>\n<p>3. Make all these services auto start at boot :<\/p>\n<pre class=\"code\"># chkconfig vsftpd on\n# chkconfig xinetd on\n# chkconfig rpcbind on\n<\/pre>\n<p>4. Check the xinetd and rpcbind status :<\/p>\n<pre class=\"code\"># service xinetd status\nxinetd (pid  1326) is running...\n\n# service rpcbind status\nrpcbind (pid  1178) is running...\n<\/pre>\n<p>5. Create the a new user named ftpuser and set password :<\/p>\n<pre class=\"code\"># useradd ftpuser\n# passwd ftpuser\nChanging password for user ftpuser.\nNew password:\nRetype new password:\npasswd: all authentication tokens updated successfully.\n<\/pre>\n<p>6. Login as ftpuser on other terminal and create a new files named &#8220;files&#8221;.<\/p>\n<pre class=\"code\"># su - ftpuser\n[ftpuser@rhel6 ~]$ cat &gt; files\nThis is file created on RHEL 6 ftp server\n<\/pre>\n<p>7. Start the vsftpd service :<\/p>\n<pre class=\"code\"># service vsftpd start\nStarting vsftpd for vsftpd:                                [  OK  ]\n<\/pre>\n<p>8. Stop the iptables linux firewall and disabled selinux :<\/p>\n<pre class=\"code\"># service ip6tables stop\nip6tables: Flushing firewall rules:                        [  OK  ]\nip6tables: Setting chains to policy ACCEPT: filter         [  OK  ]\nip6tables: Unloading modules:                              [  OK  ]\n\n# service iptables stop\niptables: Flushing firewall rules:                         [  OK  ]\niptables: Setting chains to policy ACCEPT: filter          [  OK  ]\niptables: Unloading modules:                               [  OK  ]\n# setenforce 0\nsetenforce: SELinux is disabled\n<\/pre>\n<h2>How to Configure FTP Server in Linux ?<\/h2>\n<p>9. It&#8217;s good to make backup of your original configuration file.<\/p>\n<pre class=\"code\">[root@rhel6 ~]# cp \/etc\/vsftpd\/vsftpd.conf \/etc\/vsftpd\/vsftpd.conf-bak\n<\/pre>\n<p>10. login from user account and download the files :<\/p>\n<pre class=\"code\">D:\\&gt;ftp 192.168.1.43\nConnected to 192.168.1.43.\n220 (vsFTPd 2.2.2)\nUser (192.168.1.43:(none)): ftpuser\n331 Please specify the password.\nPassword:\n230 Login successful.\nftp&gt; get files\n200 PORT command successful. Consider using PASV.\n150 Opening BINARY mode data connection for files (42 bytes).\n226 Transfer complete.\nftp: 42 bytes received in 0.00Seconds 42000.00Kbytes\/sec.\nftp&gt; quit\n221 Goodbye.\n<\/pre>\n<p>11. Check the contain of downloaded files :<\/p>\n<pre class=\"code\">D:\\&gt;type files\nThis is file created on RHEL 6 ftp server\n<\/pre>\n<p>12. By default root account is not allowed to login the vsftpd server as it&#8217;s exist in \/etc\/vsftpd\/ftpusers.<\/p>\n<pre class=\"code\">D:\\&gt;ftp 192.168.1.43\nConnected to 192.168.1.43.\n220 (vsFTPd 2.2.2)\nUser (192.168.1.43:(none)): root\n530 Permission denied.\nLogin failed.\nftp&gt;\n<\/pre>\n<p>13. Open \/etc\/vsftpd\/ftpusers file. Remove or comment out the line for user &#8220;root&#8221; and add &#8220;ftpuser&#8221; instead. Users whose name are set in this file will not allowed to login from ftp.<\/p>\n<pre class=\"code\">[root@rhel6 ~]# vi \/etc\/vsftpd\/ftpusers\n<\/pre>\n<pre class=\"code\"># Users that are not allowed to login via ftp\n#root\nftpuser\nbin\ndaemon\nadm\nlp\nsync\nshutdown\nhalt\nmail\nnews\nuucp\noperator\ngames\nnobody\n<\/pre>\n<p>14. Open \/etc\/vsftpd\/user_list file. Remove or comment out entry in \/etc\/vsftpd\/user_list files. Remove or comment out the line for user &#8220;root&#8221; and add &#8220;ftpuser&#8221; instead. Users whose names are set in this file are also not allowed to login from ftp even they are not prompt for password.<\/p>\n<pre class=\"code\"># vi \/etc\/vsftpd\/user_list\n<\/pre>\n<pre class=\"code\"># vsftpd userlist\n# If userlist_deny=NO, only allow users in this file\n# If userlist_deny=YES (default), never allow users in this file, and\n# do not even prompt for a password.\n# Note that the default vsftpd pam config also checks \/etc\/vsftpd\/ftpusers\n# for users that are denied.\n#root\nftpuser\nbin\ndaemon\nadm\nlp\nsync\nshutdown\nhalt\nmail\nnews\nuucp\noperator\ngames\nnobody\n<\/pre>\n<p>15. Root now allowed to access ftp server :<\/p>\n<pre class=\"code\">D:\\&gt;ftp 192.168.1.43\nConnected to 192.168.1.43.\n220 (vsFTPd 2.2.2)\nUser (192.168.1.43:(none)): root\n331 Please specify the password.\nPassword:\n230 Login successful.\nftp&gt; quit\n221 Goodbye.\n<\/pre>\n<p>16. ftpuser now not allowed to access ftp server :<\/p>\n<pre class=\"code\">D:\\&gt;ftp 192.168.1.43\nConnected to 192.168.1.43.\n220 (vsFTPd 2.2.2)\nUser (192.168.1.43:(none)): ftpuser\n530 Permission denied.\nLogin failed.\nftp&gt;\n<\/pre>\n<p>17. How to set login banner for ftp server :<br \/>\nOpen \/etc\/vsftpd\/vsftpd.conf look for &#8220;ftpd_banner&#8221; :<\/p>\n<pre class=\"code\"># vi \/etc\/vsftpd\/vsftpd.conf\n<\/pre>\n<p>Uncomment ftpd_banner and customize the login banner string as below :<\/p>\n<pre class=\"code\"># You may fully customise the login banner string:\nftpd_banner=Welcome to eHowStuff.com RHEL6 FTP server\n#\n<\/pre>\n<p>18 Restart the ftp service :<\/p>\n<pre class=\"code\"># service vsftpd restart\nShutting down vsftpd:                                      [  OK  ]\nStarting vsftpd for vsftpd:                                [  OK  ]\n<\/pre>\n<p>19. Try login to ftp server. Check the banner, it will appear before user login as below :<\/p>\n<pre class=\"code\">D:\\&gt;ftp 192.168.1.43\nConnected to 192.168.1.43.\n220 Welcome to eHowStuff.com RHEL6 FTP server\nUser (192.168.1.43:(none)):\n<\/pre>\n<p>If you encounter any issues on how to configure ftp server in linux, you can put a few questions in the comments below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post i will show how to install Very Secure FTP (Vsftpd) and how to configure ftp server in linux\u00a0Red Hat Enterprise Linux 6 (RHEL 6). Vsftpd is a&#8230;<\/p>\n","protected":false},"author":6,"featured_media":6421,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2058],"tags":[1396,1536,1713,1715,1905],"class_list":["post-2052","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-rhel","tag-ftp-server","tag-linux","tag-rhel","tag-rhel-6","tag-vsftpd-2"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=2052"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/2052\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/6421"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=2052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=2052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=2052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}