Having real issues with ftp access to my cloud VPS ubuntu solution.

I have tried both vsftpd and pure-ftpd. I found that both were limited. I have now tried to focus on vsftpd as it is well received.

I tried following the instructions here:


The only thing I haven't done in this guide so far is add the TLS/SSL/FTPS rules, as I am having issues adding the port 990 to the firewall settings of the server. This has been flagged with my provider and hopefully will be resolved in time.

Initially I was using users that had shell access. This was allowing the user to login and access the server and the correct folders, but could not write new files or overwrite existing files on the server. They could create folders and delete files. When I logged in with shell accounts using command line ftp, I could write (mput) files to the server no problem, but I expect this is because of the way command line ftp works as opposed to an ftp service.

I thought my problem might be that my users might not be able to access as they had shell access. I then created a new user with no shell access. I cannot login with these users. I am getting a 530 Incorrect Login, even though I have changed and tested the password. I cannot login with command line ftp either.

I have included below my vsftpd.conf file. I tried a custom one but ended up reverting to the original, just to start again. I have added the check_shell=NO directive to see if this has helped. I had started down the path of adding virtual users to the system, but I don't see how this is going to change anything.

I have quite literally spend the whole weekend trying to resolve this, to no avail.

Here are the /etc/shadow contents (-hashed pwds). The two new users are spdftp and scftp:


Here is the output of the /etc/passwd file for those users:


For the record, I used the command:

useradd scftp -d /path/to/home/dir -g ftpusers

to create the users. I didn't add a shell argument, though the system set it to /bin/sh.

I chown -Rf /var/www spdftp and chown -Rf /var/www/path/to/home scftp (I want the user spdftp as a kind of master ftp account and scftp to only have access to a specific site folder). I also chgrp -Rf /var/www ftpusers

The /etc/vsftpd.conf file is as follows:

# Example config file /etc/vsftpd.conf
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
# Uncomment this to allow local users to log in.
# Uncomment this to enable any form of FTP write command.

# Ignore shell login request

# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
# Activate logging of uploads/downloads.
# Make sure PORT transfer connections originate from port 20 (ftp-data).
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
# You may override where the log file goes if you like. The default is shown
# below.
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
# You may change the default value for timing out an idle session.
# You may change the default value for timing out a data connection.
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
# (default follows)
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
# (default follows)
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!


I'm not sure about the last line. I thought it should be pam_service_name=vsftpd but neither has worked anyway.

I also created the vsftpd.chroot_list. Here is the contents of that file:


There is a /etc/vsftpd.passwd file but it has no entries for these two usernames. I don't know how to create or add them to this if this is the problem.

Any help would be greatly appreciated. I have very little hair and what's left I'm tearing out!


I changed each users' shell to first, /bin/false and second, /bin/bash. This at least allowed me to login, without getting the 530 Incorrect login error. I get a network timed out error though after this and the following in the log (x.x.x.x is my fixed IP address):

Mon Feb 18 11:49:15 2013 [pid 2] CONNECT: Client "x.x.x.x"
Mon Feb 18 11:49:15 2013 [pid 1] [scftp] OK LOGIN: Client "x.x.x.x"
Mon Feb 18 11:50:48 2013 [pid 2] CONNECT: Client "x.x.x.x"
Mon Feb 18 11:50:49 2013 [pid 1] [spdftp] OK LOGIN: Client "x.x.x.x"

There doesn't seem to be any failure reason given in the /var/log/vsftpd.log. Not sure if there's another log I can check.


I found that I had left a couple of lines in the vsftpd.conf file:



As I had started down the path of creating virtual users. I thought I had commented this out, but I hadn't.

Now I can connect, my final issue is that I am back where I started in that my users cannot upload files to the server. The following error is in my vsftpd.log:

Mon Feb 18 12:13:54 2013 [pid 3] [spdftp] FAIL CHMOD: Client "x.x.x.x", "/path/to/home/folder/2013/humans.txt 777"

So, full circle to the same issue. Anyone anything?


For what it's worth, I resolved this issue by doing a full purge of the vsftpd service and installation and then re-install. Somewhere along the lines my settings in vsftpd must have gotten crossed wires or conflicts. I had uninstalled before, but did not know about:

aptitude purge vsftpd
aptitude autoclean

Once I did that and then did an

aptitude install vsftpd

The only setting I needed to change in the vsftpd.conf was write_enable=YES. (I also added a couple of settings to ensure users could not navigate out of their homefolder).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.