{"id":2908,"date":"2022-03-22T09:54:00","date_gmt":"2022-03-22T04:24:00","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=2908"},"modified":"2022-03-22T13:14:43","modified_gmt":"2022-03-22T07:44:43","slug":"ftp-configuration","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/ftp-configuration\/","title":{"rendered":"How to setup VSFTP Configuration"},"content":{"rendered":"<p><strong>FTP Configuration<br \/>\n<\/strong><\/p>\n<p><strong>Dated : 15\/11\/2018<\/strong><\/p>\n<p>File Transfer Protocol (FTP) is a standard Internet protocol\u00a0for transmitting files between computers on the Internet over TCP\/IP connections.FTP is a client-server protocol that relies on two communications channels between client and server<\/p>\n<p><strong>Step 1 :<\/strong> check whether the ftp is already installed in our server else install this in you server here we are using centos 7 so we installed the application using yum.<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Yum install vsftpd<\/code><\/p>\n<p><strong>Step 2 :<\/strong> After the installation service will be in disabled state in first we have to start the service and enable the service. Start the service using<br \/>\n<code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">systemctl start vsftpd<\/code><\/p>\n<p>And enable the service using<br \/>\n<code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">systemctl enable vsftpd<\/code><\/p>\n<p><strong>Step 3 :<\/strong> To use this ftp service from other system we have to access this through the port 21 so we have to enable the port number 21 in firewalld .<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">firewall-cmd --zone=public --permanent --add-port=21\/tcp\nfirewall-cmd --zone=publ to ic --permanent --add-service=ftp<\/pre>\n<p>After open the port in firewalld don\u2019t forget to reload the firewalld using<br \/>\n<code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">firewall-cmd --reload<\/code><\/p>\n<p>After the firewalld reload don\u2019t forget to check whether the port is LISTENING or not using<br \/>\n<code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">netstat -plnt | grep LISTEN<\/code><\/p>\n<p><strong>Step 4 :<\/strong> Now we are going to make some changes on the configuration file to setup and secure our FTP server.Open the config file in the location of <strong>\/etc\/vsftpd\/vsftpd.conf<\/strong><br \/>\n<strong>Note:<\/strong> If you want to change anything on the config file before that don\u2019t forget to took backup of that config file if anything goes wrong after we made changes on the config file we will replace the backup into the config file else it will create a big problem in your server.<br \/>\nMade these changes on the <strong>vsftpd.conf<\/strong> file<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">anonymous_enable=NO\nlocal_enable=YES\nwrite_enable=YES\nlocal_umask=022\ndirmessage_enable=YES\nxferlog_enable=YES\nconnect_from_port_20=YES\nxferlog_enable=YES\nlisten=NO\nlisten_ipv6=YES\npam_service_name=vsftpd\nuserlist_enable=YES\ntcp_wrappers=YES<\/pre>\n<p><strong>Step 6 :<\/strong> Then go to the location of <strong>\/etc\/vsftpd\/user_list<\/strong> Here you have to enable the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">userlist_deny=NO<br \/>\n<\/code><\/p>\n<p>this will enable the username with in the file other users are denied.<br \/>\nAnd then add the following lines in the user_list:<br \/>\n<code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">chroot_local_users=YES<br \/>\nallow_writable_chroot=YES<\/code><\/p>\n<p><strong>Step 7 :<\/strong> Restart the vsftpd service<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">systemctl restart vsftpd<\/code><\/p>\n<p><strong>Step 8:<\/strong> Test the ftp server using create the new user<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">useradd -m -c \u201cnewusername\u201d -s \/bin\/bash newusername<\/code><\/p>\n<p>passwd newuserpasswd<\/p>\n<p><strong>Step 9 :<\/strong> Add the new user name to the userlist to access the ftp.<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">echo \"newusername\" | tee -a \/etc\/vsftpd.userlist<\/code><\/p>\n<p>Make sure that created username have been added in user list, otherwise that user cannot access FTP.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FTP Configuration Dated : 15\/11\/2018 File Transfer Protocol (FTP) is a standard Internet protocol\u00a0for transmitting files between computers on the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[185,481,482],"class_list":["post-2908","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-ftp-2","tag-ftp-configuration","tag-ftp-installation","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-KU","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2908","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=2908"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2908\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2908"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2908"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2908"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}