0

I have installed vsftpd ftp server on my ubuntu and I can connect only with the admin user (the user that can be sudoed). Also when I'm connecting via ftp I see the home directory of the admin user and not the home dir of the ftp user. For all other system users I receive a 530 Login incorrect error when trying to connect.

Any idea what I've been doing wrong?

The home dir of the ftp user is \srv\ftp:

drwxr-xr-x  2 root ftp  4096 sep 26 12:13 ftp

This are my config files:

# /etc/vsftpd.conf

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=NO
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key

# Standard behaviour for ftpd(8).
auth    required    pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed

# Note: vsftpd handles anonymous logins on its own. Do not enable pam_ftp.so.

# Standard pam includes
@include common-account
@include common-session
@include common-auth
auth    required    pam_shells.so

# /etc/ftpusers: list of users disallowed FTP access. See ftpusers(5).

root
daemon
bin
sys
sync
games
man
lp
mail
news
uucp
nobody
6
  • First Error 503 is "Bad sequence of commands." en.wikipedia.org/wiki/List_of_FTP_server_return_codes , you try to login as a system user ?
    – Max Muster
    Sep 26, 2014 at 13:37
  • Sorry, I have entered the wrong error code, is 530 Login incorrect. And, yes, I'm trying to connect as a system user.
    – Marius
    Sep 26, 2014 at 13:47
  • witch system user? be a little more verbose please.
    – Max Muster
    Sep 26, 2014 at 13:49
  • whats in the logfile ? try this chroot_local_user = YES
    – Max Muster
    Sep 26, 2014 at 14:02
  • Well I'm trying to connect via a normal user account (which exists on my ubuntu) and the system user used by vsftpd is ftp
    – Marius
    Sep 26, 2014 at 14:03

1 Answer 1

0

I have solved the problem by adding /bin/bash at the end of the username in /etc/passwd:

mcristea:x:1001:1000::/home/mcristea:/bin/bash
3
  • and what was there written?
    – Max Muster
    Sep 27, 2014 at 12:42
  • just this: mcristea:x:1001:1000::/home/mcristea
    – Marius
    Sep 30, 2014 at 13:56
  • try mcristea:x:1001:1000::/home/mcristea:/bin/false, this allows the login but gives no shell. mcristea:x:1001:1000::/home/mcristea:/sbin/nologin allowes no login (this is the default).
    – Max Muster
    Oct 13, 2014 at 9:15

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.