{"id":318,"date":"2021-01-23T07:57:40","date_gmt":"2021-01-23T07:57:40","guid":{"rendered":"http:\/\/roglacup.com\/klaus62\/?p=318"},"modified":"2021-01-23T07:57:40","modified_gmt":"2021-01-23T07:57:40","slug":"ftp-connection-refused-error-solution-to-problem","status":"publish","type":"post","link":"https:\/\/roglacup.com\/klaus62\/2021\/01\/23\/ftp-connection-refused-error-solution-to-problem\/","title":{"rendered":"FTP Connection refused error \u2013 Solution to problem"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>If you get an error (ftp Connection refused) when using FTP client under Linux such as Connection refused, then you can fix this problem using following method.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Make sure ftp server installed<\/h3>\n\n\n\n<p>Make sure ftp server installed and service is running. Under Debian Linux you can use dpkg command to verify that ftp server installed:<br><code>$ dpkg -l | grep -i \"ftp\"<\/code>Output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ii  ftpd                           0.17-21                       FTP server<\/pre>\n\n\n\n<p>OR run following command:<br><code>$ dpkg -l | grep -i ftp<\/code><br>Under Red Hat\/Novell Suse\/Fedora Linux try rpm command:<br><code># rpm -qa | grep -i \"*ftp*\"<\/code><br>In any case if you have the ftp package installed it will return output. If the ftp package is not installed, it will notify you or it will not give you any output at all. Naturally next logical step is to install FTP server.<\/p>\n\n\n\n<p>Under Red Hat\/Fedora Linux install vsftpd server as follows:<br><code># up2date vsftpd<\/code><br>OR if you are using Fedora Linux use yum:<br><code># yum install vsftpd<\/code><br>If you are using Debian Linux use apt-get command:<br><code># apt-get install vsftpd<\/code><br>Next configure vsftpd by modifying \/etc\/vsftpd.conf file.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is ftp server running (is port 21 open)?<\/h3>\n\n\n\n<p>Login to ftp server using ssh and try to telnet port 21 (to see port is open or not):<br><code>$ telnet localhost 21<\/code><br>Next run netstat -tulpn command to see if port 21 is in open:<br><code>$ netstat -tulpn | grep :21<\/code><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">tcp        0      0 0.0.0.0:21             0.0.0.0:*               LISTEN<\/pre>\n\n\n\n<p>OR try following command:<br><code>$ netstat -a | grep ftp<\/code>Output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">tcp        0      0 *:ftp                   *:*                     LISTEN<\/pre>\n\n\n\n<p>If port is not open, start ftp server \/service. Under RedHat\/Fedora Linux use service command:<br><code># service vsftpd start<\/code><br>Under Debian Linux use following command:<br><code># \/etc\/init.d\/vsftpd start<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">FTP user permissions<\/h3>\n\n\n\n<p>Is particular user not allowed to use your vsftpd ftp server, then make sure user got permission to use your ftp server. File \/etc\/ftpusers \u2013 list of users disallowed use vsftpd server access. Make sure user name is not in this file.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Security or Firewall<\/h3>\n\n\n\n<p>Make sure iptables firewall\/tcpd does not block access to your ftp server. Run following command on ftp server (login over ssh):<br><code># iptables -L -n<\/code>Output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Chain INPUT (policy DROP)\ntarget     prot opt source               destination\nACCEPT     all  --  0.0.0.0\/0            0.0.0.0\/0\nACCEPT     all  --  0.0.0.0\/0            0.0.0.0\/0           state RELATED,ESTABLISHED\nACCEPT     tcp  --  0.0.0.0\/0            0.0.0.0\/0           tcp dpts:6881:6882\nACCEPT     udp  --  202.54.1.254         0.0.0.0\/0           udp dpt:514\nACCEPT     tcp  --  0.0.0.0\/0            0.0.0.0\/0           tcp dpts:80 state NEW,RELATED,ESTABLISHED\nLOG        all  --  0.0.0.0\/0            0.0.0.0\/0           LOG flags 0 level 4\nDROP       all  --  0.0.0.0\/0            0.0.0.0\/0\n\nChain FORWARD (policy ACCEPT)\ntarget     prot opt source               destination\n\nChain OUTPUT (policy ACCEPT)\ntarget     prot opt source               destination\nACCEPT     all  --  0.0.0.0\/0            0.0.0.0\/0<\/pre>\n\n\n\n<p>Above output does not allows port 21 (port 21 is blocked by firewall). You need to use\u00a0<a href=\"https:\/\/www.cyberciti.biz\/faq\/iptables-open-ftp-port-21\/\">iptables rules to open port 21<\/a>. Make sure file \/etc\/hosts.deny (TCPD wrappers) does not block access to port 21 for your ftp host.<\/p>\n\n\n\n<p>Posted from:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.cyberciti.biz\/faq\/ftp-connection-refused-error-solution-to-problem\/\">https:\/\/www.cyberciti.biz\/faq\/ftp-connection-refused-error-solution-to-problem\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you get an error (ftp Connection refused) when using FTP client under Linux such as Connection refused, then you can fix this problem using following method. Make sure ftp server installed Make sure ftp server installed and service is running. Under Debian Linux you can use dpkg command to verify that ftp server installed:$&hellip;&nbsp;<a href=\"https:\/\/roglacup.com\/klaus62\/2021\/01\/23\/ftp-connection-refused-error-solution-to-problem\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">FTP Connection refused error \u2013 Solution to problem<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[17],"tags":[],"class_list":["post-318","post","type-post","status-publish","format-standard","hentry","category-linux"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/comments?post=318"}],"version-history":[{"count":1,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/318\/revisions"}],"predecessor-version":[{"id":319,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/318\/revisions\/319"}],"wp:attachment":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/media?parent=318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/categories?post=318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/tags?post=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}