LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-23-2013, 11:25 AM   #1
konkorfour
LQ Newbie
 
Registered: Feb 2013
Posts: 5

Rep: Reputation: Disabled
Vsftpd trouble, at a total loss


I'm sorry my first post is asking for help but I have no idea what is wrong.

I've set up Apache, PHP, mySQL, PHPMyAdmin and VSFTPD, I set the user "ftp"'s home directory to /var/www/ and using sudo su I set it to 777 just to test for now. I've got the following lines active in my /etc/vsftpd.conf file:

Code:
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=NO
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem
Now, when I first installed VSFTPD with the default settings I could connect and view the one index.html file but I could not delete or upload, after changing the settings to those above I can't even login... The username and password are correct but it says:

Code:
Status:	Connecting to 192.168.0.2:21...
Status:	Connection established, waiting for welcome message...
Response:	220 (vsFTPd 2.3.5)
Command:	USER ftp
Response:	331 Please specify the password.
Command:	PASS ***********
Response:	530 Login incorrect.
Error:	Critical error
Error:	Could not connect to server
However setting anonymous_enable=YES lets me view the directory but now instead of going to /var/www/ like it used to I just go to /

I've never used VSFTPD before so I'm kind of lost here, I've tried searching but the things people have said to try either make it worse or just don't help. So does anyone have any clue how I can just set the ftp user to read/write/delete anything in the /var/www/ folder and to work properly?
 
Old 02-23-2013, 12:46 PM   #2
konkorfour
LQ Newbie
 
Registered: Feb 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Okay so reading the log it says I'm logging in anonymously even though I'm using a user/pass.
 
Old 02-23-2013, 04:41 PM   #3
konkorfour
LQ Newbie
 
Registered: Feb 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
So leaving anonymous_enable=YES, I can login and see the files for now. But I can't edit anything...

I've tried:
chown -R ftp /www/var/
chmod 777 /www/var/
write_enable=YES

Still nothing, not sure what is wrong.

I get Response: 550 Permission denied.
 
Old 02-24-2013, 09:13 AM   #4
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
, I set the user "ftp"'s home directory to /var/www/
Can this user even log in normally? On a lot of system the user 'ftp' is a really non-privileged user without login permission. You can only su into the account. So maybe we back up one step, just what tasks are you trying to accomplish?
 
Old 02-24-2013, 10:00 AM   #5
konkorfour
LQ Newbie
 
Registered: Feb 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Hangdog42 View Post
Can this user even log in normally? On a lot of system the user 'ftp' is a really non-privileged user without login permission. You can only su into the account. So maybe we back up one step, just what tasks are you trying to accomplish?
No because it's set to /bin/false, I've removed Vsftpd though I was getting too many problems with it so I switched to proftpd instead and it's working great now.
 
Old 02-24-2013, 10:19 AM   #6
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
Originally Posted by konkorfour View Post
No because it's set to /bin/false
Glad you found a solution. For future reference, this is likely why trying to connect as the FTP user didn't work. VSFTPD was doing what it was supposed to do.
 
Old 02-24-2013, 12:13 PM   #7
konkorfour
LQ Newbie
 
Registered: Feb 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Hangdog42 View Post
Glad you found a solution. For future reference, this is likely why trying to connect as the FTP user didn't work. VSFTPD was doing what it was supposed to do.
What was it supposed to do? I had tried the default created ftpuser that's made by the app, I tried my username, 2 created ones and one that I created using a guide specifically for Vsftpd.
 
Old 02-24-2013, 01:22 PM   #8
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Any user that doesn't have the ability to log in shouldn't be able to get in via FTP either. So the fact that 'ftp' was set to /bin/false should mean that if you try to connect as 'ftp' it should fail. To use FTP, the user logging in has to be able to use/create a shell and ftp clearly can't. Users like that are created as a security measure so that the FTP server isn't running as root, and if it is compromised, the attacker has no privileges.

However, a real user (presumably your username) SHOULD have been able to connect and get into a directory. Looking at your config file in the first post may be a place where this went wrong. The 'chroot_local_users' is finicky. If the users "root" dir is writeable (/home/user), vsftp will shut down the connection. That may have been what you were intending to get around with the chroot_list file, but I can't tell. You can also use the 'allotw_writeable_chroot=YES' to get around this as well. That is more global than the chroot_list and should be used with care.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
having trouble installing Rome Total War in wine christopher coker Linux - Games 1 02-04-2011 04:39 PM
Total newbie with AMD MOBO trouble R3Ddragon Linux - Newbie 4 04-21-2007 03:31 PM
total font loss mayhem in kde3.4.2 27B-6 Slackware 2 09-15-2005 07:50 PM
vsFTPd trouble SnowSurfAir Linux - Software 24 03-23-2005 07:33 AM
Total loss of power on HD seek ??? KendersPlace Linux - Hardware 4 04-27-2004 02:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration