Tuesday, March 15, 2022

[SOLVED] vsftpd on rhel 7.4 disallowing write & modify

Issue

I've successfully installed & configured vsftp. I've created a user (joe) & companion group (joes).

My user 'joe' can create, update, & delete files in it's 'home' directory without error WHEN logged in via ssh. Joe's home directoy has been set to /var/www/site via usermod -d. Joe can CRUD any files in /tmp, /home/joe, & /var/www/site when logged into the OS via ssh. After checking this I set the joe's shell to 'noshell' via usermod -s

ftpuser's local directory permissions: drwxrwxr-x. 2 ftpuser root 27 Jun 8 10:05 site

The Joe can successfully login vsftpd using FileZilla. But the Joe cannot drop files to it's home directory using FileZilla. Joe can get files from the ftp hosted directory.

Here is the current procedure I'm creating to accomplish this task.

# yum install vsftpd
# service vsftpd stop
# vi /etc/vsftpd/vsftpd.userlist

add: joe

# vi /etc/vsftpd/vsftpd.conf

add/edit:

anonymous_enable=NO
local_enable=YES
write_enable=YES
connect_from_port_20=NO
chroot_local_user=YES
local_umask=022
userlist_file=/etc/vsftpd/vsftpd.userlist
userlist_enable=YES
userlist_deny=NO

then

# useradd -d /var/www/site -s /usr/sbin/nologin joe
# passwd joe
# chown -R joe /var/www/site
# chmod 775 /var/www/site
# vi /etc/shells

if necessary, add: /usr/sbin/nologin

# addgroup joes
# usermod -G joes joe
# service vsftpd start

Starting vsftpd is successful and without errors.

What does it take to configure vsftp to allow joe to load files from a remote?


Solution

These two things make this work: local_umask=777 and useradd joe -d /var/www/site no permutation of chown and/or chown appear to affect any positive outcome



Answered By - Steve
Answer Checked By - Cary Denson (WPSolving Admin)