Vsftpd - 500 OOPS: Cannot change directory
I am trying to create a test web server/ftp server within a college for students to learn html, php etcÖ I figured to do this properly I should also teach them a little ftp and other things to give a full picture.
I have the apache set up and if I add a user on the workstation they get a public_html directories that works and their pages appear no problem.
I want the students to be able to log in with their AD 2003 usernames and passwords (I donít want to have to administer any more users/passwords). If I log in locally with the user not a problem, the students can make pages and they are hosted normally from the box.
The problem arises that the students donít have their home directories created by default until they look onto the computer so when they ftp they get:
I have tried adding the pam_mkhomedir to my /etc/pam.d/vsftp file but with no luck. File shown below [/etc/pam.d/vsftp]:
You'll have to make each home directory for a user can log in.
However, when you create the account you can do this:
useradd -m newstudent
Use the -m parameter with useradd, that way the home directory of the user will be created. Don't forget to assign a password to.
You can use passwd or you can use a command called chpasswd.
With chpasswd you can store all the passwords in one file and run it as a script. It will save you some time. You can buil your passwords script like this ...
user1 : password
user2 : password
user3 : password
(with no blank spaces between the user and password).
save to a file and then ...
chpasswd < file-with-passwords
Any way, you can look at the man page for chpasswd.
Hope it helps.
I'll post it here later if i get it working.
This isn't the best of solutions however... This script took me a lot less time to write than the googling that I did previously without success. And had I done this in the first place I'd have had to run the script a lot of times for it to add up to hours.
For anyone who is interested here is my script:
===== =========== == ======
I used wbinfo -u to pull in the user names.
Piping '|' the output through grep I was able to remove all names not '-v' containing a '$' (the machine names have a '$' on the end).
Piping '|' the output through grep again to give me only names containing a '.' (all student usernames are <surname>.<firstname>).
When root su's to another user if needed their home is created. issuing the '--command="exit"' argument to su gets su to run that command effectively as soon as su logs on as a user the user logs off (the directories is created as soon as the user logs on).
|All times are GMT -5. The time now is 09:02 AM.|