Plesk can be really annoying at times. Sometimes tasks that should be dirt simple like making a basic FTP site without associated web hosting can be next to impossible.
After wasting about a half hour hunting around in Plesk 9 for a way to make an FTP site (authenticated) that did not also set up a website, I concluded that it simply could not be done through the interface.
Fine, I'll do it the old-fashioned way: I'll Google up an answer. After visiting a couple sites courtesy of Google, a consensus emerged. The way to create an ftp site/account was to connect via SSH and use the following three commands, followed by a little tweaking of the /etc/passwd file.
/# mkdir /home/ftp
/# useradd -d /home/ftp/ftpuser/ -s /dev/null ftpuser > /dev/null 2>&1
/# passwd ftpuser
The first line creates an /ftp folder beneath /home. The second creates a new user named "ftpuser". And the third allows you to set his pasword. So far, so good.
The next generally recommended step was to edit the /etc/passwd file, changing this:
adding an extra dot slash between "ftp/" and "ftpuser". I used nano.
Didn't work. All the commands were successful, but FileZilla could not connect. Kept getting "bad login".
Back to the drawing board. My problem was that sites created in Plesk allowed too much access to uploaded content, specifically, HTTP access. It also subjected the ftp user to a hodgepodge of silly folders since the ftp account wa rooted above all the folders associated with the domain like:
Even worse, some of these folders could not be deleted, nor could files be wrtten to the "root" of this structure. Very annoying.
I decided that to make this mess usable for an FTP-only site, I needed to do two things:
- Prevent access to the bogus website via HTTP.
- Re-root the login to a secure folder just in case someone found a way around my solution to step 1.
The first part was pretty straight forward. I would drop a simple one-line .htaccess file in the various web-accessible directories to punt unwanted browsers from my site:
The next required a secure directory to which I could re-root my ftp user. Fortunately, there already was such a directory, named "private". So off I went to the /etc/passwd file again, where I changed this:
Now to test. I popped open a browser and went to my site. Got nada via HTTP except a stupid Apache message providing way more information about my server than I thought was sensible to reveal. Seems if httpdocs can't be accessed, Apache gets stupid.
Fine. I replaced the .htaccess files with a zero-byte index.html. Now all I get is a blank white screen. "Good enough for government work", as we used to say in the Army.
Now the real test: ftp. First I go to the site using various browsers using ftp://. Up pops a login screen on all of them. I provide crdentials and land in my nice empty, private root. Looking good.
One last test: FilleZilla. I enter my site and credentials and click connect. It connects, and I'm again in my private root. Time for a beer!
Hope this helps someone.