{"id":1044,"date":"2019-04-05T03:25:25","date_gmt":"2019-04-05T03:25:25","guid":{"rendered":"http:\/\/orissawebhosting.in\/blog\/?p=1044"},"modified":"2019-06-27T12:12:11","modified_gmt":"2019-06-27T12:12:11","slug":"configure-sftp-in-vps","status":"publish","type":"post","link":"https:\/\/orissawebhosting.in\/blog\/configure-sftp-in-vps\/","title":{"rendered":"configure VSFTP in VPS"},"content":{"rendered":"\n<p>Hello all,<\/p>\n\n\n\n<p>FTP&nbsp;(File Transfer Protocol) is a traditional and widely used standard tool for&nbsp;transferring files between a server and clients&nbsp;over a network, especially where no authentication is necessary it permits anonymous users to connect to a server. We must understand that FTP is unsecure by default, because it transmits user credentials and data without encryption.<\/p>\n\n\n\n<p>Today, am going to describe the steps to install, configure and secure a FTP server (VSFTPD&nbsp;stands for (Very Secure FTP Daemon)&nbsp;in VPS<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1 : Installing FTP server&nbsp;&nbsp;<\/h3>\n\n\n\n<p>1. Just run the following comment in the terminal =&gt; vsftpd is a software name of FTP<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># yum install vsftpd -y<\/pre>\n\n\n\n<p>2. After installing the software we should start and enable the service, By default the service will be disabled at first, So we need to start it manually for the first time and enable it to start automatically from the next system boot as well<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># systemctl start vsftpd \n# systemctl enable vsftpd<\/pre>\n\n\n\n<p>3. Next, in order to allow access to FTP services from external systems, we have to open port&nbsp;<strong>21&nbsp;<\/strong>in the firewall using below commands:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># firewall-cmd --zone=public --permanent --add-port=21\/tcp\n# firewall-cmd --zone=public --permanent --add-service=ftp\n# firewall-cmd --reload<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Step 2: Configuring FTP Server<\/h4>\n\n\n\n<p>4. Now we will move over to perform a few configurations to setup and secure our FTP server, let us start by making a backup of the original config file&nbsp;<strong>\/etc\/vsftpd\/vsftpd.conf&nbsp;<\/strong>file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># cp \/etc\/vsftpd\/vsftpd.conf \/etc\/vsftpd\/vsftpd.conf.bk<\/pre>\n\n\n\n<p>Next, open the config file and make the changes from YES to NO<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">anonymous_enable=NO<\/pre>\n\n\n\n<p>5.&nbsp;Now configure FTP to allow\/deny FTP access to users based on the user list file \/etc\/vsftpd\/user_list<\/p>\n\n\n\n<p>Users listed in the above file is not permited to login to FTP<\/p>\n\n\n\n<p>6.&nbsp;Now add these two following options to restrict FTP users to their Home directories<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">chroot_local_user=YES\nallow_writeable_chroot=YES<\/pre>\n\n\n\n<p>Now save the file.<\/p>\n\n\n\n<p>7. Restart the service<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># systemctl restart vsftpd<\/pre>\n\n\n\n<p>Now we will test FTP server by creating a FTP user<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># useradd -m test\n# passwd test@123<\/pre>\n\n\n\n<p>Option -m will&nbsp;Create the user&#8217;s home directory if it does not exist.<\/p>\n\n\n\n<p>Now you can access the ftp using the below command :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># ftp 192.168.43.105<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">Connected to 192.168.43.105 (192.168.43.105).\n220 (vsFTPd 3.0.2)\nName (192.168.43.105:root): harry\n331 Please specify the password.\nPassword:\n230 Login successful.\nRemote system type is UNIX.\nUsing binary mode to transfer files.\nftp&gt;\n<\/pre>\n\n\n\n<p>That&#8217;s all now you can use the ftp commands to access the files in the user&#8217;s home directory<\/p>\n\n\n\n<p>Note : By default the FTP command will not work in your vps, So you can install ftp by following the below command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># yum install ftp -y<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Hello all, FTP&nbsp;(File Transfer Protocol) is a traditional and widely used standard tool for&nbsp;transferring files between a server and clients&nbsp;over a network, especially where no authentication is necessary it permits anonymous users to connect to a server. We must understand that FTP is unsecure by default, because it transmits user credentials and data without encryption. Today, am going to describe the steps to install, configure and secure a FTP server (VSFTPD&nbsp;stands for (Very Secure FTP Daemon)&nbsp;in VPS Step 1 : Installing FTP server&nbsp;&nbsp; 1. Just run the following comment in&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/1044"}],"collection":[{"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/comments?post=1044"}],"version-history":[{"count":2,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/1044\/revisions"}],"predecessor-version":[{"id":1046,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/1044\/revisions\/1046"}],"wp:attachment":[{"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/media?parent=1044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/categories?post=1044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/tags?post=1044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}