{"id":222,"date":"2015-07-09T17:29:31","date_gmt":"2015-07-09T17:29:31","guid":{"rendered":"https:\/\/www.prolimehost.com\/blogs\/?p=222"},"modified":"2015-07-09T17:29:31","modified_gmt":"2015-07-09T17:29:31","slug":"ftp-installation-and-configuration-tutorials","status":"publish","type":"post","link":"https:\/\/www.prolimehost.com\/blogs\/ftp-installation-and-configuration-tutorials\/","title":{"rendered":"FTP Installation and Configuration Tutorials"},"content":{"rendered":"

FTP is a protocol used to transfer files between different hosts over the TCP. The ftp connection is initiated when the ftp client connects to the ftp server. The connection is opened by the ftp server on port 21.<\/p>\n

\"FTP<\/a>
FTP is a protocol used to transfer files between different hosts over the TCP<\/figcaption><\/figure>\n

There are two different types of connection that can be established between the ftp client and the ftp server. The two different types of connections are \u201cactive\u201d and \u201cpassive\u201d connections and they are determined by the ftp client.<\/p>\n

Active ftp connection:In active ftp the server initiates the connection.The client from a random port greater than port 1023 connects to the server’s port 21.
\nPassive ftp: In passive ftp the problem of the server initiating the connection is solved.The client opens two unprivileged ports i.e., x greater than 1023 and x+1. The client initiates connection from port x to the server’s port 21.After connection is initated the client instead of allowing the server to connect to the client the client sends the PASV command to the server. The server then opens a random port s that is greater than 1023. Passive ftp is the widely used mode for ftp connection and is decided by the ftp client.
\nThe below Details explain how the different ftp modes operate:
\nActive FTP<\/strong> : Command connection :ftp client port >1023 \u2013–>>> ftp server 21
\ndata connection : ftp client port >1023 <<<\u2013–ftp server 20<\/p>\n

Passive FTP<\/strong> : command connection: ftp client >1023 \u2013->>> ftp server 21
\ndata connection :ftp client >1024 \u2013–>>> ftp server >1023<\/p>\n

Installation of vsftpd on centos<\/strong><\/p>\n

vsftpd is a light-weight ftp server software .
\nNormal ftp lacks proper security. The vsftpd is an alternative to normal ftp.
\nvs ftpd stands for \u201cvery secure ftpd\u201d.<\/p>\n

Let us go through the steps to install vsftpd on a centos server:
\nWe can install vsftpd through the yum repository.
\nWe can issue the below command:
\n#yum -y install vsftpd
\nWe can also install the ftp client from the yum repository.
\n#yum install ftp
\nThe configuration file for vsftpd is \/etc\/vsftpd\/vsftpd.conf .
\nWe can then edit the vsftpd configuration file and make the necessary changes.
\n#vim \/etc\/vsftpd\/vsftpd.conf
\nWe can disable the anonymous ftp login thus reducing security related vulnerabilities.
\nanonymous_enable=NO
\nWe can enable the local_enable parameter.
\nlocal_enable=YES
\nWe can enable the chroot jail shell so that users will be jailed to their chroot (i.e., users are restricted to their home directories) and thus increase the security of the server.
\nchroot_local_user=YES<\/p>\n

We can enable the vsftpd daemon to be automatically be started during the server boot process.
\n#chkconfig vsftpd on
\nIf the ftp port is closed by the firewall we can open if through the below command:
\n#iptables -I INPUT 4 -m tcp -p tcp -m conntrack –ctstate NEW –dport 21 -j ACCEPT
\nWe then save the iptables rule.
\n#service iptables save
\nAlso make sure that we have disabled SELINUX in the server.
\nEdit the selinux configuration file i.e., \/etc\/selinux\/config
\nvim \/etc\/selinux\/config
\nand replace the parameter SELINUX=enforcing with the parameter SELINUX=disabled
\nWe can create a folder to store ftp files for a user.
\nIn this example I am creating a user named \u201csara\u201d. I amcreating the folder \/home\/sara\/ftp for Sara to store her ftp data.
\nWe first create a hoem directory for sara to store the ftp data.
\n#mkdir -p \/home\/sara\/ftp
\nWe then create the user \u201csara\u201d with the home directory \/home\/sara\/ftp sara
\n#useradd -d \/home\/sara\/ftp sara
\n#passwd sara
\nYou can create some random files to test the server.<\/p>\n

#touch \/home\/sara\/ftp\/photo1 \/home\/sara\/ftp\/letter<\/p>\n

You can open a webbrowser and open the ftp path to the remote server.<\/p>\n

The format is ftp:IP_address_of_ftp_server.<\/p>\n

We can use 3rd party ftp software l to upload or download data from the ftp server.
\nFilezila and winscp are examples of such freely available 3 rd party software.
\nFilezilla is freely downloadable from the below website:
\nhttps:\/\/filezilla-project.org\/download.php
\nWinscp can be dowloaded freely from the below website:
\nhttps:\/\/winscp.net\/eng\/download.php<\/p>\n","protected":false},"excerpt":{"rendered":"FTP is a protocol used to transfer files between different hosts over the TCP. The ftp connection is…","protected":false},"author":2,"featured_media":224,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_display_header_overlay":false,"csco_singular_sidebar":"","csco_page_header_type":"","footnotes":""},"categories":[10],"tags":[],"class_list":{"0":"post-222","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-tutorials-tips","8":"cs-entry"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.prolimehost.com\/blogs\/wp-json\/wp\/v2\/posts\/222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.prolimehost.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.prolimehost.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.prolimehost.com\/blogs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.prolimehost.com\/blogs\/wp-json\/wp\/v2\/comments?post=222"}],"version-history":[{"count":0,"href":"https:\/\/www.prolimehost.com\/blogs\/wp-json\/wp\/v2\/posts\/222\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.prolimehost.com\/blogs\/wp-json\/wp\/v2\/media\/224"}],"wp:attachment":[{"href":"https:\/\/www.prolimehost.com\/blogs\/wp-json\/wp\/v2\/media?parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.prolimehost.com\/blogs\/wp-json\/wp\/v2\/categories?post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.prolimehost.com\/blogs\/wp-json\/wp\/v2\/tags?post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}