Problems with FTP on Ubuntu linode

OK, so I am a competent person, just fairly new to Linux and Apache stuff since I've used shared hosts for so long…

I am running Ubuntu 10.4 with Apache2

1) First Question

Following one fo the guides floating around here, I created a username:group, lets call it travis:filetransfer, and set the home to /srv/www/domain.com/. I can login to my server via FileZilla with that user, and it properly starts off in the /domain.com/ directory. However, it cannot write to that dir or any subdirs. I've done everything down to the "wrong way" of even chmod'ing the dir to 777, and with my limited knowledge of chown, i did "chown travis:filetransfer /srv/www/domain.com

For those cringing, I've chmod the directory back to 755, and chown'd back to root:root.

Why can't this user name do anything? I know it is going to be a config somewhere, or that I haven't fully grasped the user/user group stuff yet.

2) I came up with the first question because of the issue for my second question:

I got a WordPress blog installed and running on my domain. When trying to use the built in plug/theme installer, it asks for my ftp login info. So I used [IPAddy]:22 and my root login/password. Whether I choose FTP or FTPS, after about 15 seconds, it simply returns to a "Failed to connect to [IPAddy]:22". After some searching around, I see some people stated they were able to get this to work by doing something with the www-data group, or the apache group (or user?), but then other areas say this is incorrect. One site looked promising by having me set something using

/usr/sbin/setsebool -P httpd_can_network_connect=1

Hoever, I do not have this command.

Sorry if this got long winded, just trying to trim off any of the usual questions incase I've already tried something you were gonna suggest. I've been running sites from shared hosts for years, and on a whim wanted to give this VPS a shot, and if I can get past some of these snags, I'll eventually migrate all my sites to my VPS.

Thanks in advance for any help.

8 Replies

And what FTP server app are you using - and how do you have it configured?

Do you really need FTP? SFTP is a better choice.

@telijah:

So I used [IPAddy]:22 and my root login/password. Whether I choose FTP or FTPS, after about 15 seconds, it simply returns to a "Failed to connect to [IPAddy]:22".
22 is SSH and SFTP. Filezila can connect using SFTP, mind.

FTP and FTPS are 21. Do you have an FTP(S) server installed at all?

Pure-FTPd, vsFTPd, proFTPd?

vonskippy and rsk: Interesting, I have not installed any. See, during one of the guides, when it had me log in using FileZilla with my root login/password, I assumed an FTP server already existed, but that is clearly wrong since I have not installed any yet.

orb: I imagine I DO need one for Wordpress, as it's only options are FTP and FTPS.

I'll go look up installing vsFTPd as I've seen a lot of documentation on that one already, unless you guys see other reasons to go with another. I don't need terribly "powerful" or feature rich options. As long as I can setup a user and assign any home directory I'd like.

Thanks for the info guys.

I'm personally a fan of pure-ftpd, it's nice, simple, and has a low footprint. Can be compiled to use system user database, or a separate one, in plaintext, mysql, or postgres storage. Also, there are "true chroot" and "fake chroot" builds, where the latter allows you to escape the home directory via symlinks. Debian offers all variations pre-packaged.

Remember, you want to use FTP only as a last resort. Wordpress connecting via 127.0.0.1 is safe (well, as far as one can use "wordpress" and "safe" together). Letting your users upload files via it… not so much.

If you're the only one using wordpress, when you need wordpress to install an update or a plugin, simply chown the wordpress files to the user running your php scripts, install the update/plugin then chown it back to whoever owned it previously. That way you've no need for a nasty ftp server.

@telijah:

I'll go look up installing vsFTPd as I've seen a lot of documentation on that one already, unless you guys see other reasons to go with another. I don't need terribly "powerful" or feature rich options. As long as I can setup a user and assign any home directory I'd like.
That's what I currently use on one server for site updates, and yes, it's pretty easy to isolate the directory used for each authenticated user through per-user config files. The users don't have to exist as actual users on the system if you don't want, but can simply be used for FTP authentication, then appearing as a guest account in terms of filesystem protections.

As for the FTP vs. SFTP question, for me it was part a legacy issue on the part of clients, but also when I went looking I really found no decent way to provide SFTP with each user locked into a configured directory, and that didn't require actual login accounts on the system.

vsftpd also supports FTPS which (client support permitting - FileZilla does for example) can keep things just as secure.

– David

We just set up our first Linode this week to run our Wordpress blog, which has outgrown shared hosting. Initially we installed the LAMP/Wordpress stack. Using that setup, I was able to download plugins from within Wordpress with no problem.

However, the script places Wordpress in a directory rather than in the public root. This was going to create lots of problems for our migration, so we did a clean LAMP (Ubuntu) install and then a fresh WP install in the public root. Everything seems to work except I get the exact same error the OP described when I try to add plugins.

I tried CHMODing the contents dir to 777 and that didn't help at all.

I guess my question is this. What is in the all-in-one Wordpress stack script that solves this problem? Does it install FTP as well? Somehow it makes the plugin download/upgrade work. Does anyone know how? I'm thinking this might be a simpler way to solve the problem.

Also, I'm going to request a root option be added to the script if I can find the right thread on this forum. This would make life a lot easier.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct