<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Setting the umask for SFTP transactions</title>
	<atom:link href="http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions/feed" rel="self" type="application/rss+xml" />
	<link>http://jeff.robbins.ws</link>
	<description>The ramblings and interests of a thirty something admin/programmer.</description>
	<lastBuildDate>Fri, 27 Jan 2012 13:50:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: jeffro</title>
		<link>http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions/comment-page-2#comment-5783</link>
		<dc:creator>jeffro</dc:creator>
		<pubDate>Tue, 20 Dec 2011 00:24:22 +0000</pubDate>
		<guid isPermaLink="false">http://jeff.robbins.ws/setting-the-umask-for-sftp-transactions#comment-5783</guid>
		<description>HI Bryan, this unfortunately doesn&#039;t work. The sftp subsystem doesn&#039;t spin up a bash shell to complete the command. Thus, your.bashrc file is never read. This was one of the first things I tried when I initially encountered this issue.</description>
		<content:encoded><![CDATA[<p>HI Bryan, this unfortunately doesn&#8217;t work. The sftp subsystem doesn&#8217;t spin up a bash shell to complete the command. Thus, your.bashrc file is never read. This was one of the first things I tried when I initially encountered this issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan</title>
		<link>http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions/comment-page-2#comment-5775</link>
		<dc:creator>Bryan</dc:creator>
		<pubDate>Mon, 19 Dec 2011 17:13:08 +0000</pubDate>
		<guid isPermaLink="false">http://jeff.robbins.ws/setting-the-umask-for-sftp-transactions#comment-5775</guid>
		<description>try adding umask command to .bashrc 
(.bash_profile is for interactive)


~]$ cat .bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions

# Friendly file creation mask
        umask u=rwx,g=rwx,o=r</description>
		<content:encoded><![CDATA[<p>try adding umask command to .bashrc<br />
(.bash_profile is for interactive)</p>
<p>~]$ cat .bashrc<br />
# .bashrc</p>
<p># Source global definitions<br />
if [ -f /etc/bashrc ]; then<br />
        . /etc/bashrc<br />
fi</p>
<p># User specific aliases and functions</p>
<p># Friendly file creation mask<br />
        umask u=rwx,g=rwx,o=r</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Malcolm</title>
		<link>http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions/comment-page-2#comment-5324</link>
		<dc:creator>Malcolm</dc:creator>
		<pubDate>Mon, 28 Nov 2011 20:40:13 +0000</pubDate>
		<guid isPermaLink="false">http://jeff.robbins.ws/setting-the-umask-for-sftp-transactions#comment-5324</guid>
		<description>I hope this can save someone else hours of frustration...

If you&#039;re using a GUI SFTP application, check its preferences for setting permissions on upload.

I had tried all the solutions above, and it turns out the application was just overriding them.</description>
		<content:encoded><![CDATA[<p>I hope this can save someone else hours of frustration&#8230;</p>
<p>If you&#8217;re using a GUI SFTP application, check its preferences for setting permissions on upload.</p>
<p>I had tried all the solutions above, and it turns out the application was just overriding them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glitch Hop</title>
		<link>http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions/comment-page-2#comment-4674</link>
		<dc:creator>Glitch Hop</dc:creator>
		<pubDate>Tue, 27 Sep 2011 20:32:42 +0000</pubDate>
		<guid isPermaLink="false">http://jeff.robbins.ws/setting-the-umask-for-sftp-transactions#comment-4674</guid>
		<description>Interesting! I finally realized why the -u flag wasn&#039;t allowing the SFTP session to launch.  That flag is only available in OpenSSH_5.4p1 and above, and i was running OpenSSH_5.3p1 :(

http://serverfault.com/questions/70876/how-to-put-desired-umask-with-sftp</description>
		<content:encoded><![CDATA[<p>Interesting! I finally realized why the -u flag wasn&#8217;t allowing the SFTP session to launch.  That flag is only available in OpenSSH_5.4p1 and above, and i was running OpenSSH_5.3p1 <img src='http://jeff.robbins.ws/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p><a href="http://serverfault.com/questions/70876/how-to-put-desired-umask-with-sftp" rel="nofollow">http://serverfault.com/questions/70876/how-to-put-desired-umask-with-sftp</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions/comment-page-2#comment-4585</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Wed, 14 Sep 2011 07:54:38 +0000</pubDate>
		<guid isPermaLink="false">http://jeff.robbins.ws/setting-the-umask-for-sftp-transactions#comment-4585</guid>
		<description>Sadly, we are in the process of migrating from SLES to RHEL.  Most systems are v6, but in the case of the above one it is v5.5.  
RHEL v6.1 comes with OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010, so reasonably recent. 

I would have preferred Debian or Solaris, but non-IT folk made the decision...</description>
		<content:encoded><![CDATA[<p>Sadly, we are in the process of migrating from SLES to RHEL.  Most systems are v6, but in the case of the above one it is v5.5.<br />
RHEL v6.1 comes with OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010, so reasonably recent. </p>
<p>I would have preferred Debian or Solaris, but non-IT folk made the decision&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeffro</title>
		<link>http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions/comment-page-1#comment-4582</link>
		<dc:creator>jeffro</dc:creator>
		<pubDate>Tue, 13 Sep 2011 15:06:50 +0000</pubDate>
		<guid isPermaLink="false">http://jeff.robbins.ws/setting-the-umask-for-sftp-transactions#comment-4582</guid>
		<description>I have seen in the past that RHEL uses very old versions of certain services. Very stable, but very old. I rarely ever use Red Hat based distro&#039;s on my servers, so I don&#039;t encounter this much. 

Thanks for the posts @simon</description>
		<content:encoded><![CDATA[<p>I have seen in the past that RHEL uses very old versions of certain services. Very stable, but very old. I rarely ever use Red Hat based distro&#8217;s on my servers, so I don&#8217;t encounter this much. </p>
<p>Thanks for the posts @simon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions/comment-page-1#comment-4581</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Tue, 13 Sep 2011 14:50:44 +0000</pubDate>
		<guid isPermaLink="false">http://jeff.robbins.ws/setting-the-umask-for-sftp-transactions#comment-4581</guid>
		<description>Note that RHEL 5.5 uses an old OpenSSH version:
# ssh -V
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
The RPM package is : openssh-server-4.3p2-41.el5_5.1

This is quite old. The latest version is 5.9.  
Version 4.3 was released on February 1, 2006</description>
		<content:encoded><![CDATA[<p>Note that RHEL 5.5 uses an old OpenSSH version:<br />
# ssh -V<br />
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008<br />
The RPM package is : openssh-server-4.3p2-41.el5_5.1</p>
<p>This is quite old. The latest version is 5.9.<br />
Version 4.3 was released on February 1, 2006</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions/comment-page-1#comment-4580</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Tue, 13 Sep 2011 14:40:24 +0000</pubDate>
		<guid isPermaLink="false">http://jeff.robbins.ws/setting-the-umask-for-sftp-transactions#comment-4580</guid>
		<description>Tried this on RHEL 5.5 kernel 2.6.18-194.17.4.el5PAE

TEST 1:
Subsystem sftp /bin/sh -c &#039;umask 0002; /usr/libexec/openssh/sftp-server&#039;

Restarted ssh.
Result: Ignored umask, and instead put file with rw-r--r--

TEST2: 
Subsystem      sftp    /usr/libexec/openssh/sftp-server -u 0002

Restarted ssh.
Result:  Unable to log in via SFTP.  Authenication works, but Connection closed

TEST3
Subsystem      sftp    /usr/libexec/openssh/sftp-server
Restarted ssh.
Removed .bashrc and .bash_profile from user home directory.
Added only this line into .bash_profile:    umask 0002
Result: File put as -rw-r--r--

TEST4
Subsystem      sftp    /usr/libexec/openssh/sftp-server
Restarted ssh.
Removed .bashrc and .bash_profile from user home directory.
Set umask locally  as:   umask 0002  and then ran sftp command.
Result: File put as -rw-r--r--

TEST5
Same as TEST4, but set umask within SFTP client e.g:
sftp&gt; lumask 0002
Local umask: 002
Result: File put as -rw-r--r--

Conclusion: Umask setting over SFTP on RHEL 5.5 is unimplemented.  What a load of cr*p.</description>
		<content:encoded><![CDATA[<p>Tried this on RHEL 5.5 kernel 2.6.18-194.17.4.el5PAE</p>
<p>TEST 1:<br />
Subsystem sftp /bin/sh -c &#8216;umask 0002; /usr/libexec/openssh/sftp-server&#8217;</p>
<p>Restarted ssh.<br />
Result: Ignored umask, and instead put file with rw-r&#8211;r&#8211;</p>
<p>TEST2:<br />
Subsystem      sftp    /usr/libexec/openssh/sftp-server -u 0002</p>
<p>Restarted ssh.<br />
Result:  Unable to log in via SFTP.  Authenication works, but Connection closed</p>
<p>TEST3<br />
Subsystem      sftp    /usr/libexec/openssh/sftp-server<br />
Restarted ssh.<br />
Removed .bashrc and .bash_profile from user home directory.<br />
Added only this line into .bash_profile:    umask 0002<br />
Result: File put as -rw-r&#8211;r&#8211;</p>
<p>TEST4<br />
Subsystem      sftp    /usr/libexec/openssh/sftp-server<br />
Restarted ssh.<br />
Removed .bashrc and .bash_profile from user home directory.<br />
Set umask locally  as:   umask 0002  and then ran sftp command.<br />
Result: File put as -rw-r&#8211;r&#8211;</p>
<p>TEST5<br />
Same as TEST4, but set umask within SFTP client e.g:<br />
sftp&gt; lumask 0002<br />
Local umask: 002<br />
Result: File put as -rw-r&#8211;r&#8211;</p>
<p>Conclusion: Umask setting over SFTP on RHEL 5.5 is unimplemented.  What a load of cr*p.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions/comment-page-1#comment-4576</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Mon, 12 Sep 2011 14:32:42 +0000</pubDate>
		<guid isPermaLink="false">http://jeff.robbins.ws/setting-the-umask-for-sftp-transactions#comment-4576</guid>
		<description>I tried all of the above methods on RHEL 5 ,and none worked.   I restarted ssh each time.</description>
		<content:encoded><![CDATA[<p>I tried all of the above methods on RHEL 5 ,and none worked.   I restarted ssh each time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How do I set default permissions for SFTP for an Ubuntu Server? - Admins Goodies</title>
		<link>http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions/comment-page-1#comment-4354</link>
		<dc:creator>How do I set default permissions for SFTP for an Ubuntu Server? - Admins Goodies</dc:creator>
		<pubDate>Wed, 17 Aug 2011 08:03:05 +0000</pubDate>
		<guid isPermaLink="false">http://jeff.robbins.ws/setting-the-umask-for-sftp-transactions#comment-4354</guid>
		<description>[...] Soure: http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions [...]</description>
		<content:encoded><![CDATA[<p>[...] Soure: <a href="http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions" rel="nofollow">http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions</a> [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

