One of the ideas which I recently saw another enthusiastic Linux user comment about was, that the program “Bluefish”, which can be installed from Linux package-managers, is almost an ideal program for Web-design, and one of the reasons given was the fact that additionally, under Linux, it’s possible to mount a remote FTP-server’s directory, to a local mount-point, and then, to edit the HTML, CSS and PHP Files directly within this mount-point. While I like enthusiasm for a good thing, I would prefer not to lead my readers into a situation where they could run into error messages, and then become frustrated, because they might not be able to resolve those. Instead, I’d prefer to have run into some error messages myself, found a solution, and then explain to the community, what worked for me.
For starters, even though I do some minimal Web-design, my way of doing it is, to maintain a set of folders within my home directory, which stays synced between my computers, but then, to use “FileZilla” to upload changes I made to those folders’ files, to an FTPS-server, with point-and-click methods. FileZilla can also be installed from most Linux package managers, has a GUI, and supports secure connections to the FTP-server. If the reader is paying attention, he or she will notice that by implication, I have an FTP-server running on the PC that acts as my Web-server, that I force the exchange of passwords to be encrypted, and that my FTP-server and -client reside side-by-side on computers in the same room, on my private LAN.
The reader may infer that I’m not the most trusting person.
But, just to verify whether the option can be forced to work, that the FTP-server’s directories can be mounted locally, and then, theoretically, also edited in-place, I next discovered that virtually the only solution available is a package called ‘curlftpfs’, which performs a FUSE-mount. Lately, I’ve begun to like FUSE-mounts, especially without any of the mount options that would require root. But what I found next was, that ‘curlftpfs’ was particularly temperamental. Whatever the client-side mount doesn’t like about the server-side configuration, results in a short error message, and perhaps, a frustrated Web-author.
And so, I’m happy to share what it was, that made the error message go away in my situation. The first thing that the reader would need to visualize is, how the system directories are set up, using ‘vsftpd’, in this case for the user ‘www-data’, which owns all the Web-content, and, exposing Port 21 to the LAN, but not even to the WAN. This is the root of any static HTML I might want to host:
Directory Owner ------------ -------- /var root +-www root +-html www-data
While this detail may strike the reader as irrelevant, in fact it’s not, as I found out. That would be, because the Home Directory of the user ‘
www-data‘ was set up, by me, several years ago, as being ‘
/var/www‘, not, ‘
/var/www/html‘. What this means is that, unless some directive was set up on the client-side, to navigate to sub-directory ‘
html‘ directly when logging in, from wherever this FTP user’s home directory was, the simple diagram which I just wrote above, would cause the Error 530 Message.
But there was a simultaneous problem causing the same error message: When the ‘curlftpfs’ command is given, with the ‘tlsv1′ option, at least under Debian 9 / Stretch, this just causes the authentication error, regardless of how sure the user has been, that his username and password were provided correctly.
On that subject I should also note, that the correct way to get this mount to work would be, that the user set up the file ‘~/.netrc’, that being, a file in his home directory, on the client computer, that stores his username and password in plain-text form. If the user puts his password on the command-line, then it will also go into the command-history of his shell interpreter, and additionally, be visible in the processes list. This a correct ‘.netrc’ File, for use with ‘curlftpfs':
machine ftps://dirkmittler.homeip.net/ login www-data password <my-password>
What I eventually found out was, that ‘curlftpfs’ does in fact read and use this file correctly. But, once I got my FTPS-mount to succeed, I also deleted this file, and continued my experiment with the following command-line:
curlftpfs -o ssl,no_verify_peer,user=www-data ftp://dirkmittler.homeip.net/html ~/mnt
What the ‘
user=www-data‘ option does is, to cause the command to ignore the ‘.netrc’ File, and to prompt the user to type in his password (invisibly) by hand. I found that using this feature eventually also works. And, at the end of the (remote computer’s) host-name, in my case, the characters ‘
/html‘ are important, for the reason I gave above.
Although this mode of operation can be forced to work, I wouldn’t prefer it as my main way of uploading files, because it’s just too rickety. I’ll just go back to using FileZilla.