vsftp issue when uploading a file to network windows share
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
vsftp issue when uploading a file to network windows share
I'm running slackware 14.
my config looks like this.
anonymous_enable=no
local_enable=YES
write_enable=YES
#local_umask=022
local_umask=000
ftpd_banner=FTP.
chroot_local_user=YES
chroot_list_enable=YES
allow_writeable_chroot=YES
chroot_list_file=/etc/vsftpd.chroot_list
The rest of the file is just default commented out.
ssl is enabled as well
I have a windows share setup with permission everyone checked full.
This is setup in the fstab
mount.cifs //Machinename/test /home/ftp/ftpclients -o rw,username=USERNAME,password=PASSWORD 0 0
My newly created users are not put into chroot_list and are locked down to their home directory.
When I log in with that userid I see the folder that was setup under adduser. I can even switch to other folders. I can download a file but can not upload a file. Error 553 could not create file, critical file transfer error.
I'm thinking this has to be security over the folder but i'm lost on how to fix this.
users homes are created on the mount so mary is /home/ftp/ftpclients/mary
Running ls -l under ftpclients I see permission as drwxr-xr-x 0 root root 0
I created a folder from the windows machine under mary called test. It has the same permissions when i look at it from terminal.
vsftpd.log shows the file t1.txt a _ i r mary ftp 0 * i
k this is a bit strange, i'm logged in as root on the terminal.
I ran the commands above and they completed with no errors etc.
I run ls -l and it is still showing drwxr-xr-x 0 root root 0 under both folders.
I mounted a windows file share (cifs) and "touched" a file. All good.
Then I tried to change ownership. All bad. Same as what you're seeing.
I've done a bit of searching, and it seems as though the entire cifs mount is going to have the same owner:group and you can't change it. I'm going to poke around a bit more, and I suggest you do the same.
Bottom line: the problem is the perms on the cifs mount, and you're going to need different ownership for the different subdirectories on that mount. Not sure if that's possible. Windows doesn't have the same notion of ownership as Linux.
hmm - a previous sys admin here had setup an older version of slackware running on our Vm server.
I've pretty much copied all that was there and the cifs mount there as well.
The permissions on those folder are drwxrwxrwx 1 root root 0.
On the windows side the shared folder is setup same security/share permissions.
You might try playing around with the gid and dir_mode arguments for the "mount.cifs" command.
Try to get things set up with the gid option so that the directories are owned by some group (ftpgroup, maybe). Add all your FTP users to that group.
Then use dir_mode to ensure the group permissions on your subdirectories and files are all 7 (i.e. 775).
Then test writing to those directories (FTP upload of a file). This should work, because all your subdirectories will allow full access to anyone in ftpgroup.
Then make sure your chroot_local_user setting in your vsftpd.conf file is keeping folks from messing with each other's directories.
Thank you lrtward for all of your help.
I have finally been able to upload a file, i'll have to test it a bit more but here is what I have under fstab now.
You're welcome! Actually I didn't really help much, it was just lucky that I had a CIFS share mounted to my own linux box so it was easy for me to play with and realize that the problem was that Windows/CIFS doesn't understand Linux's notion of permissions. In retrospect, it is obvious.
You did all the hard work of playing with the mount options.
Be sure and verify that your FTP users cannot access one another's accounts! I think your vsftpd settings will prevent that, but with wide open permissions you do want to test some to make sure.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.