[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: file mode of scp/sftp

On Wed, Jan 04, 2012 at 06:48:31PM +0000, T o n g wrote:
> On Wed, 04 Jan 2012 17:23:12 +0000, Camaleón wrote:
> >> If users scp/sftp to my host, how is the default mode of files copied
> >> determined? Is it from users' umask in their ~/.profile, or somewhere
> >> else?
> > 
> > For ssh connections I'm not sure this still applies. Look at "man 8
> > sshd" and scroll down to the "login process" section.
> >From which it looks like one's ~/.profile setting (eg umask) is not 
> honoured when doing scp. That complies with my observation. From
> How the SCP protocol works 
> http://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
> It looks like scp will just blindly apply 0644 to files and 0755 to 
> directories. However, I was trying to enable the group write bit.

Maybe investigate pam_umask.so and edit the appropriate PAM
configuration file under /etc/pam.d e.g. sshd.  No guarantees--
it's just a suggestion to try which should set the session umask
on login.


  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.

Reply to: