FTP-ing fails when the user's home dir is mounted as another
Posted: Sat Sep 25, 2010 5:41 pm
Hi,
I'm using CentOS 5 for my LAMP/web server set-up, just installed vsftpd and set it up so that my user (which I'll call myftpaccount) is chrooted to their home directory, which works as expected and I can FTP in without any problems. What I want to do though is make it so that when this user logs-in they see the /var/www/html directory instead.
I've set it so that this directory is owned by the apache user/group and I've then added myftpaccount to that group. To try and 'redirect' the user to the /var/www/html directory I then did this
mount --bind /var/www/html /home/myftpaccount
but now the FTP account won't log-in - I keep getting a "bad password" message. If I unmount the bind the FTP account works again.
My questions are:
1. Why won't the login work any more? Has what I've done stopped vsftpd being able to authenticate the account?
2. Would another way to achieve the same thing be to change the settings in /etc/passwd so that the user's home directory is /var/www/html
Thanks in advance,
Mecha Godzilla
I'm using CentOS 5 for my LAMP/web server set-up, just installed vsftpd and set it up so that my user (which I'll call myftpaccount) is chrooted to their home directory, which works as expected and I can FTP in without any problems. What I want to do though is make it so that when this user logs-in they see the /var/www/html directory instead.
I've set it so that this directory is owned by the apache user/group and I've then added myftpaccount to that group. To try and 'redirect' the user to the /var/www/html directory I then did this
mount --bind /var/www/html /home/myftpaccount
but now the FTP account won't log-in - I keep getting a "bad password" message. If I unmount the bind the FTP account works again.
My questions are:
1. Why won't the login work any more? Has what I've done stopped vsftpd being able to authenticate the account?
2. Would another way to achieve the same thing be to change the settings in /etc/passwd so that the user's home directory is /var/www/html
Thanks in advance,
Mecha Godzilla