FTP – Added User with Adduser but Can’t Login Through FTP

ftpvsftpd

I'm setting up and FTP server, and I want to be able to login myself and do whatever I want, but if I want others to connect to my server, I give them credentials that restrict them to the home directory.
I've created the user with:

adduser username
passwd username
mkdir /home/user_dir
usermod -d /home/user_dir

I then enabled chroot_local_user=YES and chroot_list_enable, created a file and put my username in it so that I still have access to the entire machine.

If I ftp as myself, I can login and do whatever I want, but I can't login as this new user. (I get 530 Login Incorrect).

Info:

Linux Mint

Using vsftpd

I can login to a shell as the new user (su newUser... password)

Also – if I remove myself from the chroot list, I get the 500 OOPS refusing to run with writeable root inside chroot. I'm assuming this error will be the same with the new user, how do I give them restricted access if I get this error when restricting their access?
Fixed – forgot about writeable chroot

Best Answer

Look at your /etc/passwd file Find your user and look shell (example ttr:x:501:501::/home/username/ttr:/sbin/nologin) Add this shell (/bin/false or /sbin/nologin) to your /etc/shell or /etc/shells After that, check your connection

Try again...If it still does not work

Back up the config file before making a change;

sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.back

and then edit vsftpd.conf (with vi or nano)

nano /etc/vsftpd.conf

Then make the following change

pam_service_name=ftp

Save your change and restart the ftp server (if you use nano hit CTRL+O & enter to save then CTRL+X to exit)

sudo service vsftpd restart
Related Question