How do files transferred via ftp or sftp gets thier permissions at destination? | Unix Linux Forums | Solaris

  Go Back    


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

How do files transferred via ftp or sftp gets thier permissions at destination?

Solaris


Tags
ftp permissions

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-09-2013
kchinnam kchinnam is offline
Registered User
 
Join Date: Jul 2008
Last Activity: 29 April 2014, 10:34 PM EDT
Location: US
Posts: 142
Thanks: 15
Thanked 2 Times in 2 Posts
Wrench How do files transferred via ftp or sftp gets thier permissions at destination?

We have umask defined under /etc/.login as 022.
I have my user specific umask defined in /userhome/.login as 002.
I understand ftp will not execute anything at destination, it simply transfers files.
But it seem to be using 022 as umask for the files transferred. How does ftp knows what umask to use, where does it get from on Solaris?


Code:
-rw-r--r-- 1 user group 2012 Jan 9 09:59 file.dat

Sponsored Links
    #2  
Old 01-09-2013
Peasant's Avatar
Peasant Peasant is offline
Registered User
 
Join Date: Mar 2011
Last Activity: 21 November 2014, 7:50 AM EST
Posts: 677
Thanks: 18
Thanked 153 Times in 149 Posts
Check this :
Synopsis - man pages section 4: File Formats

You will need to define a class of user(s) and defumask, or just defumask.
The Following User Says Thank You to Peasant For This Useful Post:
jim mcnamara (01-09-2013)
Sponsored Links
    #3  
Old 01-09-2013
kchinnam kchinnam is offline
Registered User
 
Join Date: Jul 2008
Last Activity: 29 April 2014, 10:34 PM EDT
Location: US
Posts: 142
Thanks: 15
Thanked 2 Times in 2 Posts
peasant thanks for point me in the right direction. I read that page, its not clear to me what the syntax is to create a class and define defumask.
I see that we have "/wh/etc/ftpd/ftpaccess".
If I have to allow group "allusers" to have 775 on folders and 664 on files transferred by uses that belong to "allusers" group, how would that look like?

Last edited by kchinnam; 01-09-2013 at 03:16 PM.. Reason: carification
    #4  
Old 01-10-2013
Peasant's Avatar
Peasant Peasant is offline
Registered User
 
Join Date: Mar 2011
Last Activity: 21 November 2014, 7:50 AM EST
Posts: 677
Thanks: 18
Thanked 153 Times in 149 Posts
I have tried this with default solaris 11 install, but it doesn't work.

Seems like the default service proftpd with it's configuration file /etc/proftpd.conf
So you will need to modify that configuration file and add this or similar directive :

Code:
<Directory> /export/home/test>
Umask 007 007
AllowOverwrite on
</Directory

Now if user writes to /export/home/test it will create rw-rw---- (664).

Per user configuration is done with IFuser directive, but that requires mod_ifsession.c module loaded.

I'm still trying to figure out which ftp server solution actually uses /etc/ftpd/ftpaccess, will get back to you.

Update : Seems like in older versions of Solaris (before 11), ftpd is based on wu-ftpd which uses ftpaccess ftpusers files for configuration.

Hope this helped.
Regards
Peasant.

Last edited by Peasant; 01-10-2013 at 06:04 AM..
Sponsored Links
    #5  
Old 01-10-2013
kchinnam kchinnam is offline
Registered User
 
Join Date: Jul 2008
Last Activity: 29 April 2014, 10:34 PM EDT
Location: US
Posts: 142
Thanks: 15
Thanked 2 Times in 2 Posts
Peasant,
I came across two possible solutions to this,, but could not try it yet as it requires root access and better understanding of how this works on solaris 8.

1.
use of defumask to control file permissions discussed here,,
NexentaStor Project - ftpd defumask - NexentaStor Project
it would be nice to get more explanation of how this works and how to do this for a specific user group or folder structure.

2.

Code:
# second one is possibly adding '-u 002'(default umask to ftpd to have 002 !?) to following entry to /etc/inetd.conf.
# But this may have unintended results as it may apply this to all ftp related uploaded files/folders on to the server.
# Since a server has multiple applications running and owned by different groups. how can we control this for a specific application user or group?
ftp stream tcp nowait <user/group?> /usr/sbin/tcpd /wh/sbin/in.ftpd -l -a -u 002


Last edited by kchinnam; 01-10-2013 at 11:52 AM.. Reason: formatting
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
FTP/SFTP/SCP Files forums123456 Shell Programming and Scripting 2 02-02-2012 02:07 PM
Validating the size of file transferred from ftp server to the local system jpundalik Shell Programming and Scripting 2 04-08-2011 02:21 PM
How to know number files transferred azazalis Shell Programming and Scripting 9 08-13-2006 06:49 AM
FTP user files permissions problems!!! budrito HP-UX 3 04-07-2005 07:27 AM
Insufficient permissions on ftp'ed files from WIN2K to HP-UX Anamika HP-UX 7 05-16-2004 03:56 PM



All times are GMT -4. The time now is 12:26 PM.