No FTP account possible in external storage (Error: stat(): stat failed for ftp://xxx:xxx@ip-removed/upload/ at /var/www/nextcloud/apps/files_external/lib/Lib/Storage/StreamWrapper.php#127)

Hi, I’m using NC 21.0.2.

Created a ftp account on my server which is accessible with FileZilla. No problems.
I tried to add the ftp account with the same credentials in the external storage section. Only get the red “!”. No connection possible.

Perhaps limitations of password length in the menu of the external storage part? Password is 100 digits

What do I have to enter? This is my FileZilla setting.

Unbenannt

Thanks

Really?
I understand paranoia in our surveillance society but isn’t this overdone?
How about trying a password 1/10th that length?

Hi @hokaido

I agree with @anon71540698. 100 characters are overkill :wink:

But I wouldn’t use FTP anymore these days. FTP is antique and can or should be considered depracted. The fact that TLS was added at some point doesn’t make it any better. I suspect that the checbox “FTP über TLS anfordern” causes the problem anyway. Is the FTP server configured to support SSL properly? And does the External Storage App even support FTP with TLS?

I would recomend to use SFTP instead of FTP. If the server is running an OpenSSH server, which it does, if you can access it via SSH otherwise. And if the user you are trying to access it, has its public SSH-Keys stored on that server, you wouldn’t even have to enter a password and everything would work safely “out of the box”. Of course you can use username/password combinations too, if the server is only accessable localy, but for public facing SSH servers I would always recommand using SSH-Keys.

Nobody is tiping passwords these days. Neither for FileZilla nor other logins. So I don`t see any reason to use passwords with less digits.
Accounts must be SSL/TLS because the scanner places the scans here. Scanner does not support SSH I think

Ah ok. Didn’t know a scanner was involved. But if there is any chance that your scanner does support other secure protocols, use one of them. The best one would be WebDAV! If the server resides in your local network, you could maybe also use NFS or SMB, but only if both the server and the scanner are local! :wink:

If your server is remote and you absololutly have to use FTP with TLS, I am afraid, I can’t help you with that, because I never did it myself. But maybe this guide is of any help: Setting Up a Secure FTP Server using SSL/TLS on Ubuntu

The FTP server was set up as described in the tutorial. I tried another FTP account on a different server. No Luck. Also tried both different account on a separate Nextcloud server. No luck.

The Scanner is capable for NFS and SMB as well as SSL/TLS. Both my Nextcloud server are not local, so I need SSL/ TLS.

Are you using a self signed certificate on the FTP server, like in the guide? Maybe that’s what causes the issue. Found this in the docs…

Optionally, Nextcloud can use FTPS (FTP over SSL) by checking Secure ftps://. This requires additional configuration with your root certificate if the FTP server uses a self-signed certificate.

https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage/ftp.html

https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage_configuration_gui.html#using-self-signed-certificates

Problem solved…

  1. Do not type in ftp://xxx but only the server domain or IP
  2. You have to add the port by “:21” e.g.

No hint given, that the port number is mandatory, everybody things you must not define a standard port. You do not have to add the port for webav either.

Strange. But now it works.

Thanks to all.

1 Like

That was a bit too fast. It worked with another FTP account, but not with the one I had in mind.
The relevant one, does not use self signed certificates but full Lets Encrypt one, the same ones I use for https and the ones working on filezilla.

No hacker tests passwords for hacking. attacker reads passwords. Then there is no difference between 10 or 100 digits. They need one try.

Anyway, it is not working

I think you must first test with deactivated encryption.

If you use self signed certs on your FTP server, you have to import the root certificate to your Nextcloud server to make it work. There used to be an Import option in the GUI of the External Storage app, as described in a further link of my previous post. But this option seems to be gone, according to this discussion on GitHub… Import SSL root certificate setting missing - or is it gone for good? · Issue #9062 · nextcloud/server · GitHub

I’m afraid you have to do it manually. Maybe this instructions mentioned in the GithHub Issue I linked, can help you with that…

@bb77 :
Thanks, but using standard Lets Encrypt certificates. No selfsigned ones. But I will check this link.

just one idea that came to me…

Does the FTP server actualy use the Let’s Encrypt certificates? I can vaguely remember, that I had to play around with the permissions of the certificate folders/files so that other software than the web server (in my case it was the Prosody XMPP server) could access them.

@bb77 :
Yes the Let’s Encrypt certificates are generated for https use and I also use them for the FTP Server. Can you remember which permissions you have set.
BTW: It works fine with https and also with FileZilla. So I’m wondering why it doesn’t work with NC.

You should test the connection without SSL to determine whether it’s the problem.

Also, is the Nextcloud server behind a layer of NAT or a firewall? Remember that FTP is a very old and strange protocol and has some strange port usage that quite often causes problems.

Is FileZilla also the server? If so, be aware that using virtual directories may not work with some clients.

Still have no solution for the problem.
The only error I get is:
Error: stat(): stat failed for ftp://xxx:xxx@ip-removed/upload/ at /var/www/nextcloud/apps/files_external/lib/Lib/Storage/StreamWrapper.php#127

No problems to connect with filezilla. Certificates are generated for xx.domain which points to this ip.
But there is no difference if I use xx.domain oder ip. No connection possible.
BTW: My scanner is also not able to connect to this ftp account.

VSFTP was installed with this tutorial:
https://www.howtoforge.de/anleitung/wie-installiert-und-konfiguriert-man-einen-ftp-server-vsftpd-mit-ssl-tls-unter-ubuntu-2004/
The only thing I changed was not to use their self-signed certificates but mines I already hav for xx.domain.

Any ideas?