0

I am for at least 5 hours trying to setup new login with his own home directory for vsftpd on my server running Centos.

Steps that I have done:

useradd <user>
passwd <user>
chown -R <user> /var/www/mywebsite
groupadd <group>
gpasswd -a <user> <group>
chgrp -R <group> /var/www/mywebsite
chmod -R g+rw /var/www/mywebsite

also I have enabled the local_enable in vsftpd.conf chroot_local_user as well

and moved the HOME directory to the folder mentioned above

The thing is, that now even when I try to use the ftp from the machine (through ssh) I can login with my default user on the machine with its password, but when I try to login with the newly created it fails. Maybe it has something to do with this: http://prntscr.com/c3feji when I log in as the new user to the machine it doesn't look as usual, where I can see the username and folder in which I am, also lot of commands don't work.

So my question in conclusion is, is there something I missed when creating the new user? Thanks in advance for your help!

JF

EDIT: I have used the virtual users instead which works perfectly for me, still I would like to keep this question opened, as answers could help people with similar problems.

  • Hi, it is not duplicate, it is just the thread I used to follow steps to setup my ftp. The problem is probably more in the setup of the user which now appears to not be valid one and prevent me from logging into the ftp on localhost. – Jakub Folejtar Aug 9 '16 at 9:49
  • So you only need users to do FTP and not actually login ? Have I understood you right ? – voidspacexyz Aug 9 '16 at 11:10
  • Yes, the problem is, that my normal user can login easily with its password, but when I create new one, and let vsftpd to use users in the pc as logins to ftp, it doesn't work, always says that the credentials are wrong. I am pretty sure that the credentials I am using are the same, as I always set it to something like "password" without a possibility of wrong keyboard language. – Jakub Folejtar Aug 9 '16 at 11:23
  • Also just for information, I need this only to work with one wordpress template which wants me connection via ftp, and I have another ways to achieve the template installation, but as I always need to figure out what is wrong there, I can't stop finding the problem. It wants me to access one folder, which I cannot set as home folder of my default user, because he is running lot of processes and I am kind of scared to kill them, and without killing them, it doesn't let me to change things for this user. – Jakub Folejtar Aug 9 '16 at 11:25
  • From my understanding, I have put up an answer, see if that works – voidspacexyz Aug 9 '16 at 11:52
0

You just have to say that, the user cannot login.

This is one standard way I know.

To any user you create, just change the mod to do this :

usermod -s /sbin/nologin username

This will block the user from logging in.

Also when creating user itself, you could od this

useradd -s /sbin/nologin test3

You have a user available, but cant login to the system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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