LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-27-2021, 12:22 PM   #1
peter7089
Member
 
Registered: May 2016
Distribution: MX Linux
Posts: 249

Rep: Reputation: Disabled
Problem connecting to ftp server


I installed arch lnux on Thinkpad T420 and using it as home server connected to my wireless home network. I installed ftp server but i have problem connecting to it. With Filezilla i get this error:
Code:
 Could not read from transfer socket: ECONNRESET - Connection reset by peer
If i use the terminal i am able to connect to the ftp server using this command 'ftp 192.168.100.10' and then entering user and password, and i am also able to execute some commands successfully, but if i try to use ls i get disconnected with this error:
Code:
421 Service not available, remote server has closed connection
I am following the ftp setup guide from here and in /etc/vsftpd.conf file i have enabled only these two settings: write_enable=YES and local_enable=YES, and i haven't changed anything else.

Any idea what is causing this problem?
 
Old 06-27-2021, 12:55 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,777

Rep: Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996
Quote:
Originally Posted by peter7089 View Post
I installed arch lnux on Thinkpad T420 and using it as home server connected to my wireless home network. I installed ftp server but i have problem connecting to it. With Filezilla i get this error:
Code:
 Could not read from transfer socket: ECONNRESET - Connection reset by peer
If i use the terminal i am able to connect to the ftp server using this command 'ftp 192.168.100.10' and then entering user and password, and i am also able to execute some commands successfully, but if i try to use ls i get disconnected with this error:
Code:
421 Service not available, remote server has closed connection
I am following the ftp setup guide from here and in /etc/vsftpd.conf file i have enabled only these two settings: write_enable=YES and local_enable=YES, and i haven't changed anything else.

Any idea what is causing this problem?
If those are the only things you changed, it's hard to say without seeing anything from the logs. This guide:
https://vitux.com/install-vsftpd-ftp-server-tls-ubuntu/

..while written for Ubuntu, is a pretty good basic guide. Ignore the steps about installing the package, all you're interested in is configuration. That said, since you're able to connect from the terminal, are you doing this from the local host or another machine on the network? If it's the local machine, have you ensured that SELinux and/or the firewall is allowing FTP? Typically, any 4xxx messages from FTP indicate connection failure. First thing you should check is firewall and SELinux.
 
Old 06-27-2021, 01:33 PM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,369
Blog Entries: 3

Rep: Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771
Quote:
Originally Posted by peter7089 View Post
Any idea what is causing this problem?
I would say the problem is caused by attempting to set up FTP in 2021, over 20 years after it has been deprecated by SFTP. If you have a strong reason for using FTP, it is possible to get working -- with a lot of effort and fiddling, before even considering the problems that getting it through the firewall will present.

However, if your use-case is just to transfer files, or if you wish to transfer files securely, or if you have a limited amount of time and money to throw at the problem, then it would be very highly recommended to just modernize and use SFTP instead. SFTP is part of the OpenSSH server and works out of the box.
 
2 members found this post helpful.
Old 06-27-2021, 01:40 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,777

Rep: Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996
I don't disagree with Turbocapitalist at all. SFTP/SCP/SSH is a MUCH better solution.
 
Old 06-27-2021, 01:59 PM   #5
peter7089
Member
 
Registered: May 2016
Distribution: MX Linux
Posts: 249

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
If those are the only things you changed, it's hard to say without seeing anything from the logs. This guide:
https://vitux.com/install-vsftpd-ftp-server-tls-ubuntu/

..while written for Ubuntu, is a pretty good basic guide. Ignore the steps about installing the package, all you're interested in is configuration. That said, since you're able to connect from the terminal, are you doing this from the local host or another machine on the network? If it's the local machine, have you ensured that SELinux and/or the firewall is allowing FTP? Typically, any 4xxx messages from FTP indicate connection failure. First thing you should check is firewall and SELinux.
Which logs do you need?

I installed only the basic system packages for arch linux: base, linux, linux-firmware and few additional packages, like networkmanager and sudo. I didn't install firewall and SELinux.

I am connecting from another pc on the home network, which have MX Linux installed.
 
Old 06-27-2021, 02:02 PM   #6
peter7089
Member
 
Registered: May 2016
Distribution: MX Linux
Posts: 249

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Turbocapitalist View Post
I would say the problem is caused by attempting to set up FTP in 2021, over 20 years after it has been deprecated by SFTP. If you have a strong reason for using FTP, it is possible to get working -- with a lot of effort and fiddling, before even considering the problems that getting it through the firewall will present.

However, if your use-case is just to transfer files, or if you wish to transfer files securely, or if you have a limited amount of time and money to throw at the problem, then it would be very highly recommended to just modernize and use SFTP instead. SFTP is part of the OpenSSH server and works out of the box.
Security is not a issue, it's a home network. Besides, i want to use Kodi to stream videos from the laptop and the easiest way should be over ftp.
 
Old 06-27-2021, 02:27 PM   #7
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,369
Blog Entries: 3

Rep: Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771
Quote:
Originally Posted by peter7089 View Post
Security is not a issue, it's a home network.
Security will be an issue at some point. An additional advantage of SFTP is that unlike FTP it can be used safely over the open Internet. With SFTP you have that option later, with FTP you don't.

Quote:
Originally Posted by peter7089 View Post
Besides, i want to use Kodi to stream videos from the laptop and
Acknowledged.

Quote:
Originally Posted by peter7089 View Post
the easiest way should be over ftp.
Nope. There are no circumstances in which FTP is the easiest to deploy.

Code:
pacman -Syu
pacman -S openssh
You mentioned FileZilla, it is one of the many clients supporting SFTP.
 
Old 06-27-2021, 02:46 PM   #8
peter7089
Member
 
Registered: May 2016
Distribution: MX Linux
Posts: 249

Original Poster
Rep: Reputation: Disabled
I can connect over ssh and sftp without problem, but Kodi don't have option for sftp connection. Before i had fedora server installed on the laptop and i was able connect to it over ftp, i don't know what is the issue with arch linux.
 
Old 06-27-2021, 02:50 PM   #9
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,369
Blog Entries: 3

Rep: Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771
I don't use Kodi, so I am just guessing on that side of things, but it appears that SFTP support would be through an add-on if the package OpenSSH server is not available:

https://kodi.tv/addons/matrix/vfs.sftp/
 
Old 06-27-2021, 05:58 PM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,777

Rep: Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996
Quote:
Originally Posted by peter7089 View Post
Which logs do you need?
I installed only the basic system packages for arch linux: base, linux, linux-firmware and few additional packages, like networkmanager and sudo. I didn't install firewall and SELinux. I am connecting from another pc on the home network, which have MX Linux installed.
There is something preventing a connection; and while you may not have intentionally installed a firewall (ufw? iptables?) or selinux, it may still be there. And that doesn't address whether or not you have it running on the MX Linux box, and have permissions set to allow FTP on it. And the last two FTP threads you posted indicated a firewall/connection issue as well:
https://www.linuxquestions.org/quest...er-4175692043/
https://www.linuxquestions.org/quest...er-4175682832/

Quote:
Originally Posted by peter7089
Security is not a issue, it's a home network. Besides, i want to use Kodi to stream videos from the laptop and the easiest way should be over ftp.
Sorry, no...easiest way would be to use minidlna and advertise the system on the network as a DLNA server. Second easiest would be to use sshfs and mount the remote resource on the Kodi box. Third easiest is a simple Samba public share...FTP is way down the list.

Last edited by TB0ne; 06-27-2021 at 06:01 PM.
 
Old 06-28-2021, 01:19 AM   #11
peter7089
Member
 
Registered: May 2016
Distribution: MX Linux
Posts: 249

Original Poster
Rep: Reputation: Disabled
SFTP support seems to be implemented recently in Kodi. Will have to test it and see how it works.
Still it will be good if i can make ftp connection work, because Krusader do not support sftp.
 
Old 06-28-2021, 01:36 AM   #12
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,369
Blog Entries: 3

Rep: Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771Reputation: 3771
Progress!

For what it's worth, all file managers, including krusader, support SFTP connections these days. Press ctrl-L and then enter the URI for your box. It'll be in the form sftp://peter7089@192.168.1.1/home/peter7089/ or something along those lines. Another option would be ctrl-N and then select SFTP from the pull-down menu.

Last edited by Turbocapitalist; 06-28-2021 at 01:38 AM.
 
Old 06-28-2021, 05:09 AM   #13
peter7089
Member
 
Registered: May 2016
Distribution: MX Linux
Posts: 249

Original Poster
Rep: Reputation: Disabled
If i press Ctrl+L and enter the url for sftp connection i get this:
Code:
Error: Protocol not supported by Krusader
If i press Ctrl+N in pull down menu i see only options for ftp and webdav connections.
 
Old 06-28-2021, 12:20 PM   #14
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,793

Rep: Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952Reputation: 5952
I believe you need to install kio-extras to add sftp support.
 
Old 06-28-2021, 12:52 PM   #15
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,777

Rep: Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996Reputation: 7996
Quote:
Originally Posted by peter7089 View Post
If i press Ctrl+L and enter the url for sftp connection i get this:
Code:
Error: Protocol not supported by Krusader
If i press Ctrl+N in pull down menu i see only options for ftp and webdav connections.
Again, you are doing this the VERY hard way. Setting up minidlna is all you need to do...edit one config file, point it to your media folder(s), and that's it. Kodi will pick it up as just another streaming server. Done.

If all you want is media streaming, that's all you need to do.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP error -ftp://192.168.122.176/repodata/repomd.xml: [Errrno 14] FTP error 550 - petespa CentOS 3 11-28-2015 05:07 PM
LXer: Setup FTP server using VsFtp and Configure Secure FTP connections on Ubuntu 14.04 Server LXer Syndicated Linux News 0 08-20-2014 07:00 PM
when I use ftp://user@ftp.blah.com it works. But when I type just ftp.blah.com says.. hunterhunter Linux - General 15 03-05-2014 09:12 AM
file transfer from one ftp server to another ftp server divyashree Linux - Newbie 7 02-24-2010 02:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration