Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Probably getting fed up with the amount I have posted today lol.

I am trying to find a tutorial which will show me how to correctly install and setup vsftpd on centos 5.5... This is probably one of the most simplist of tasks, however I am still a newbie and just trying to setup a server on our local network which will act as an intranet.

I have everything else installed and working... Anonymous ftp works and I can get to the /var/www/html/ directory, however I just can't seem to get user accounts to work.

*** CuteFTP 8.3 - build Aug 25 2008 ***

STATUS:>    [06/08/2010 15:04:49] Getting listing ""...
STATUS:>    [06/08/2010 15:04:49] Connecting to FTP server... 192.168.1.136:21 (ip = 192.168.1.136)...
STATUS:>    [06/08/2010 15:04:49] Socket connected. Waiting for welcome message...
        [06/08/2010 15:04:49] 220 (vsFTPd 2.0.5)
STATUS:>    [06/08/2010 15:04:49] Connected. Authenticating...
COMMAND:>   [06/08/2010 15:04:49] USER j0nR
        [06/08/2010 15:04:49] 331 Please specify the password.
COMMAND:>   [06/08/2010 15:04:49] PASS *****
        [06/08/2010 15:04:52] 530 Login incorrect.
ERROR:>     [06/08/2010 15:04:52] Not logged in.
STATUS:>    [06/08/2010 15:04:54] Connection closed.

I am about ready to smack my head on the table!

I am not sure I have even setup the ftp users correctly, any further information you require please do let me know but you will have to talk to me like the newbie that I am.

Thanks in advance, and happy friday :)


EDIT

listen=YES
anonymous_enable=NO
#anon_root=/var/www/html/
#anon_upload_enable=YES
#anon_mkdir_write_enable=YES
local_enable=YES
virtual_use_local_privs=YES
write_enable=YES
connect_from_port_20=YES
secure_chroot_dir=/var/run/vsftpd
pam_service_name=vsftpd
guest_enable=YES
user_sub_token=$USER
local_root=/var/www/html/$USER
chroot_local_user=YES
hide_ids=YES
tcp_wrappers=YES
userlist_enable=YES
userlist_deny=NO

That is my vsftpd.conf file.

share|improve this question

3 Answers 3

It would probably be more useful to paste your vsftpd config, but check the following:

  • The username is allowed to login to FTP. If the username is in /etc/vsftpd/user_list then you need to ensure that, in /etc/vsftpd/vsftpd.conf, userlist_enable=YES and userlist_deny=NO. If the username is not present then you need to make sure that, if userlist_enable=YES then userlist_deny=NO or is not present.

  • Check the shell and home directory in the passwd file. Type vipw and check that the shell is not /bin/false (change it to /sbin/nologin if it is) - I'm not sure why this is an issue but I've seen it cause problems before. Next, set the home directory to wherever you want the user to login to. Not essential, but more secure.

  • Ensure that the user has access to the directory. Do su j0nR - and then try to cd into their home directory. If it works, it's probably a password issue. Type passwd j0nR and set it to what you think it should be.

Good luck.

share|improve this answer
    
I updated with my vsftpd.conf file. :) –  jonraw Aug 6 '10 at 14:37
    
Still keep getting COMMAND:> [06/08/2010 15:47:32] USER j0nR [06/08/2010 15:47:32] 530 Permission denied. –  jonraw Aug 6 '10 at 14:47
    
Updated the conf file as per your ideas, and still not working... :( –  jonraw Aug 6 '10 at 14:54
    
It's refusing to allow the user to login. Try using ftp from the command line on the server, so: ftp localhost It will ask for the username, enter j0nR. If it then denies entry before asking for the password it's an issue with the userlist. Otherwise it's either an issue with the password or with the user not being able to access their home directory. –  James Lawrie Aug 6 '10 at 15:03
    
Ok, I can login and it then fails after entering the password... I have tried countless times to change the password and I have setup multiple accounts and still not working... I am going to try and reinstall it all over again and see what happens... It's driving me nuts... I threw a follow your way on twitter for all the help you have given me today lol. :) –  jonraw Aug 6 '10 at 15:11

Check /etc/shells to ensure that the shell your user account is set to is included there. If it isn't, the account can't use ftp, period. Usually I specify /bin/false for ftp-permitted non-interactive-shell users, and /sbin/nologin for users which I don't want to have a shell OR ftp access.

If you have userlist_enable=yes, then you need a userlist_file=/etc/ftpusers (or some other file). Add the users you want to permit access to that file (unless you have userlist_deny=yes as well, in which case users will be permitted if they are not in that file).

share|improve this answer

edit

/etc/vsftpd/vsftpd.conf

and check if chroot_local_user=YES is there..if it's not there , add it..it makes sure that they user that we are gonna create will be able to access only the directory assigned to him . and also local_enable=YES

adding user

useradd -d /path/to/your/directory jonraw

this will add a user called jonraw. then set password

passwd jonraw

there are many more things to take care of like changing permissions of the directory , disabling ssh login for the user etc.. you can read more options about vsftpd in the below url. http://vsftpd.beasts.org/vsftpd_conf.html

share|improve this answer
    
Weirdly, I still have no joy with that. User / Password set fine with no errors and still getting the above errors. :( Thanks for trying to help though. –  jonraw Aug 6 '10 at 14:39
    
did you restart vsftpd after changing /etc/vsftpd/vsftpd.conf ?? /etc/init.d/vsftpd restart or service vsftpd restart –  Vamsi Aug 6 '10 at 14:51
    
I used service vsftpd restart, I always restart no matter what changes I make just to be safe. Please bare in mind that this on a local network, could this be the cause of my problems? –  jonraw Aug 6 '10 at 14:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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