| Summary: | No way to set default umask for SFTP server | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Amy Louv <alouv> | ||||||
| Component: | sftp-server | Assignee: | Assigned to nobody <unassigned-bugs> | ||||||
| Status: | CLOSED FIXED | ||||||||
| Severity: | enhancement | CC: | dennis.jenkins.75, djm, dtucker, hans | ||||||
| Priority: | P2 | ||||||||
| Version: | 4.3p2 | ||||||||
| Hardware: | Other | ||||||||
| OS: | Mac OS X | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 1626 | ||||||||
| Attachments: |
|
||||||||
|
Description
Amy Louv
2006-09-16 07:18:03 AEST
(In reply to comment #0) > There is no way to set a default umask for the SFTP server. [...] > Workaround: Use FTP instead, and risk having your passwords stolen. Another workaround: sftp-server inherits it umask from the shell (since it's run via "sh -c") so you can set it in /etc/profile or equivalent. That said, since sftp-server understands arguments these days then adding one for umask might be a reasonable idea. I think there's a bunch of Gentoo users including me that are interested in this feature aswell, now that the Gentoo core system packages team decided to ditch the sftplogging (http://sftplogging.sourceforge.net/) features of the openssh ebuild. See my ticket at http://bugs.gentoo.org/show_bug.cgi?id=154440 Created attachment 1205 [details]
Add -u option to sftp-server
This is easy now that sshd_config Subsystem declarations (and sftp-server) can accept commandline arguments. This patch adds a -u option to sftp-server to set an explicit umask. Please test.
I have just tested your patch against openssh 4.5p1 and it works fine for the umask-setting part. I did add a small change to process_open to mimic the behavior of the sftplogging patch, which is to set the mode to 0666 to force the umask on newly created files. Same for process_mkdir, with mode 0777. We should look at this for the 5.4 release. Created attachment 1673 [details]
Revised patch
patch applied. This will be in openssh-5.4 Mass move of RESOLVED bugs to CLOSED now that 5.3 is out. *** Bug 1715 has been marked as a duplicate of this bug. *** With the release of 5.4p1, this bug is now considered closed. |