The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
FreeBSD Support
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 FTP permissions
Author: Mike 
Date:   19-12-01 18:53

Hi everybody!

When I FTP files from an NT machine to my FreeBSD unix box, the permissions rw------- are automatically assigned to those files. I'm using normal FTP, not anonymous. I know it's not hard to change the permissions once they're on unix, but is there a way to set up my unix system to assign different permissions to the incoming FTP files? Maybe a config file somewhere or something like that? I know it's not the FTP program on the NT machines doing it because we had an Irix system we used to FTP to from the NT boxes, and that gave us different permission settings for the files once they were on UNIX(which luckily turned out to be the ones we needed anyway).
Any help is greatly appreciated.


Reply To This Message
 Re: FTP permissions
Author: Dan Larsson 
Date:   19-12-01 20:07

It seems you have a "too" restrictive umask setting
in your upload directory.

From the ftpd(8) manpage:
% man ftpd | grep umask
UMASK change umask, e.g. ``SITE UMASK 002''

Here below is a short example of what I mean:
% ls -la
total 2
drwxr-xr-x 2 dan rtnoc 512 19 Dec 17:47 .
drwxr-xr-x 27 dan rtnoc 512 19 Dec 17:43 ..
% touch file_A.txt
ls -l file_*
-rw-r--r-- 1 dan rtnoc 0 19 Dec 17:43 file_A.txt
% umask 077
% touch file_B.txt
% ls -l file_*
-rw-r--r-- 1 dan rtnoc 0 19 Dec 17:43 file_A.txt
-rw------- 1 dan rtnoc 0 19 Dec 17:44 file_B.txt
% umask 022
% touch file_C.txt
% ls -l file_*
-rw-r--r-- 1 dan rtnoc 0 19 Dec 17:43 file_A.txt
-rw------- 1 dan rtnoc 0 19 Dec 17:44 file_B.txt
-rw-r--r-- 1 dan rtnoc 0 19 Dec 17:45 file_C.txt


Reply To This Message
 Re: FTP permissions
Author: Mike 
Date:   20-12-01 17:57

Thanks for the Advice Dan. In the FTP program on NT, I entered the SITE command umask 022, and it made all of the uploaded files thereafter have the correct permissions (the default was 066), just like you pointed out. Whenever I end the FTP session and start a new one, however, the permissions are reset to umask 066.

Are these default permissions set on the UNIX box, or is it on the NT end? If it's on the UNIX box, where would I make the changes? There are going to be, eventually, many users FTPing to the UNIX system, and I was hoping to make one or two changes on UNIX that will change the defaults for everyone in one shot, and change them for good.

Thanks again for all the useful advice!!!!


Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 

 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Remember my login:
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum