LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 06-12-2012, 11:58 AM   #1
tiedyeguy64
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 pam_umask.so 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, 04:56 AM   #2
bakdong
Member
 
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:

http://jeff.robbins.ws/articles/sett...p-transactions

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


Reply



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 07:10 PM
LXer: Restricting Users To SFTP Plus Setting Up Chrooted SSH/SFTP (Debian Squeeze) LXer Syndicated Linux News 0 09-06-2011 07:10 AM
umask for internal-sftp users ? Vilius Linux - Software 1 01-04-2011 08:51 AM
Setting umask for incoming sftp users lensem Linux - Software 1 12-29-2008 03:15 PM
setting setting umask for apache user only....how?..plz help mickyman Linux - General 0 05-08-2006 04:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:40 AM.

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