Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-12-2012, 12:58 PM   #1
LQ Newbie
Registered: Oct 2004
Posts: 19

Rep: Reputation: 0
ssh / sftp umask setting

I have (2) samba servers running (debian Lenny/samba 3.5.6/openssh 5.5p1). I need a way for remote users to have access to the shared data (0777 permissions).

We were using WinSCP, but it does not allow drive-mapping in windows. It worked with only one or two remote users, but does not really fit the bill for a rollout to 10 - 12 remote users.

I found a piece of software called ExpanDrive, which uses an ssh connection, maps it to a windows drive, and then does transfers via sftp protocol. The only issue is that ANY time a remote user writes to a file it gets permissions of 0644. I have been trying to force the umask to 0000, which (I believe) would give 0777.

I have tried setting the umask in /etc/ssh/sshd_config with:

Subsystem sftp /usr/lib/openssh/sftp-server -u 0000

This has no effect.

I have also tried setting it in PAM by adding:

session optional umask=0000

to /etc/pam.s/sshd. Still no change.

I have been trying to get this to work for a few weeks, and have tried virtually everything I can find, all without success. The software vendor for ExpanDrive has been no help - they are more on the Windows side of things. I have read so many posts on this issue my head is spinning.

Everyone that needs access are on windows based machines. Any suggestions on where else to look would be greatly appreciated!
Old 06-15-2012, 05:56 AM   #2
Registered: Apr 2009
Posts: 214

Rep: Reputation: 44
The sftp system is spawned by the root user, and takes that umask. You should be able to change it with the -u command but you say you've tried that. Maybe an alternative would be:

Subsystem sftp /bin/sh -c ‘umask 0002; /usr/lib/openssh/sftp-server’

or use a wrapper script. See the following for more details:

Last edited by bakdong; 06-15-2012 at 05:57 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
sftp setting umask ?? lensem Linux - Server 0 05-17-2012 08:10 PM
LXer: Restricting Users To SFTP Plus Setting Up Chrooted SSH/SFTP (Debian Squeeze) LXer Syndicated Linux News 0 09-06-2011 08:10 AM
umask for internal-sftp users ? Vilius Linux - Software 1 01-04-2011 09:51 AM
Setting umask for incoming sftp users lensem Linux - Software 1 12-29-2008 04:15 PM
setting setting umask for apache user help mickyman Linux - General 0 05-08-2006 05:37 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:38 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration