<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: my umask doesnt work when doing scp in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652979#M41320</link>
    <description>&lt;!--!*#--&gt;&amp;gt; [...] Are sftp and scp work differently?&lt;BR /&gt;&amp;gt; [...]&lt;BR /&gt;&lt;BR /&gt;They're spelled differently for a reason.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] If yes then what patch should i imply&lt;BR /&gt;&amp;gt; [...]&lt;BR /&gt;&lt;BR /&gt;I have no idea.  I didn't even know about the&lt;BR /&gt;patch for SFTP.&lt;BR /&gt;&lt;BR /&gt;Have you considered using SFTP instead of&lt;BR /&gt;SCP?</description>
    <pubDate>Mon, 28 Jun 2010 12:11:53 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2010-06-28T12:11:53Z</dc:date>
    <item>
      <title>my umask doesnt work when doing scp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652971#M41312</link>
      <description>When i create teh files locallay on teh system then the umask works perfectly fine. However when i scp the files from a differnt server then the files doesnt stick to the default permission i have set on destination.&lt;BR /&gt;&lt;BR /&gt;i have already tried numerous workaround like:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions" target="_blank"&gt;http://jeff.robbins.ws/articles/setting-the-umask-for-sftp-transactions&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/sag-pam_umask.html" target="_blank"&gt;http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/sag-pam_umask.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;here is the example&lt;BR /&gt;&lt;BR /&gt;Source&lt;BR /&gt;[ajhingan@station1 ajhingan]$ umask&lt;BR /&gt;0027&lt;BR /&gt;&lt;BR /&gt; [ajhingan@station1 ajhingan]$ ls –ltr abc&lt;BR /&gt;-rw-r-----    1 ajhingan ajhingan        0 Jun 25 07:13 abc&lt;BR /&gt;&lt;BR /&gt;Destination&lt;BR /&gt;&lt;BR /&gt;[ajhingan@station2 ~]$ scp ajhingan@station1:/home/ajhingan/abc .&lt;BR /&gt;&lt;BR /&gt;[ajhingan@station2 ~]$ umask&lt;BR /&gt;0002&lt;BR /&gt;&lt;BR /&gt;[ajhingan@station2 ~]$ ls -ltr&lt;BR /&gt;total 0&lt;BR /&gt;-rw-r----- 1 ajhingan ajhingan 0 Jun 25 07:14 abc&lt;BR /&gt;&lt;BR /&gt;Any help will really be greatly appreciable</description>
      <pubDate>Fri, 25 Jun 2010 13:12:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652971#M41312</guid>
      <dc:creator>Jhingan</dc:creator>
      <dc:date>2010-06-25T13:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: my umask doesnt work when doing scp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652972#M41313</link>
      <description>Your problem is that scp always tries to mantain the permissions of the file. In this case, you will always get the permissions of the original file and your local umask won't take effect. This is a scp "feature" or limitation in your case.&lt;BR /&gt;&lt;BR /&gt;You could try something like:&lt;BR /&gt;&lt;BR /&gt;ssh ajhingan@station1 dd if=/home/ajhingan/abc | dd of=abc&lt;BR /&gt;&lt;BR /&gt;This will copy the file to the local host and the umask will be applied to the file permissions.</description>
      <pubDate>Fri, 25 Jun 2010 15:15:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652972#M41313</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2010-06-25T15:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: my umask doesnt work when doing scp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652973#M41314</link>
      <description>did you try the -p flag?&lt;BR /&gt;&lt;BR /&gt;scp -p ajhingan@station1:/home/ajhingan/abc .&lt;BR /&gt;&lt;BR /&gt;it should perserve the permission set on station1.</description>
      <pubDate>Fri, 25 Jun 2010 16:20:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652973#M41314</guid>
      <dc:creator>Wilfred Chau_1</dc:creator>
      <dc:date>2010-06-25T16:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: my umask doesnt work when doing scp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652974#M41315</link>
      <description>Thanks Ivan &amp;amp; Wilfred for your solutions but unfortunately none of thm going to help me in my case as the source is not defined. The file can come from any one of the thousands of servers but the good part is that the user will remain the same. So the only thing left is to make changes at the destination where we can mandate a umask of 0002 for that particular user. Any thoughts?</description>
      <pubDate>Sat, 26 Jun 2010 02:03:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652974#M41315</guid>
      <dc:creator>Jhingan</dc:creator>
      <dc:date>2010-06-26T02:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: my umask doesnt work when doing scp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652975#M41316</link>
      <description>does anyone has a solution to my problem??&lt;BR /&gt;</description>
      <pubDate>Sun, 27 Jun 2010 10:22:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652975#M41316</guid>
      <dc:creator>Jhingan</dc:creator>
      <dc:date>2010-06-27T10:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: my umask doesnt work when doing scp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652976#M41317</link>
      <description>I am trying to use&lt;BR /&gt;sftpfilecontrol (&lt;A href="http://sftpfilecontrol.sourceforge.net/)" target="_blank"&gt;http://sftpfilecontrol.sourceforge.net/)&lt;/A&gt; to manage the&lt;BR /&gt;umask on a per-user basis. However, I can't get it to work too</description>
      <pubDate>Sun, 27 Jun 2010 13:21:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652976#M41317</guid>
      <dc:creator>Jhingan</dc:creator>
      <dc:date>2010-06-27T13:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: my umask doesnt work when doing scp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652977#M41318</link>
      <description>&lt;!--!*#--&gt;&amp;gt; I am trying to use [...]&lt;BR /&gt;&lt;BR /&gt;Not a useful description of what you did.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] I can't get it to work too&lt;BR /&gt;&lt;BR /&gt;Not a useful description of what happened&lt;BR /&gt;when you did it.&lt;BR /&gt;&lt;BR /&gt;Did you notice that "scp" and "sftp" are&lt;BR /&gt;spelled differently?</description>
      <pubDate>Sun, 27 Jun 2010 16:28:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652977#M41318</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-06-27T16:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: my umask doesnt work when doing scp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652978#M41319</link>
      <description>Sorry if i wasnt too much descriptive in my previous post. This is what i tried&lt;BR /&gt;&lt;BR /&gt;I integrated a sftpfilecontrol patch v1.3 with my openssh 5.1p1 and build an rpm for that. I can now see my sshd_config file is showing me the Umask changed option.&lt;BR /&gt;&lt;BR /&gt;[root@station1 SPECS]# nc localhost 22&lt;BR /&gt;SSH-2.0-OpenSSH_5.1p1+sftpfilecontrol-v1.3&lt;BR /&gt;&lt;BR /&gt;[root@station1 ~]# cat /etc/ssh/sshd_config | grep -i sftp&lt;BR /&gt;SftpUmask 0002&lt;BR /&gt;Subsystem       sftp    /usr/libexec/openssh/sftp-server&lt;BR /&gt;&lt;BR /&gt;[root@station1 ~]# uname -i&lt;BR /&gt;i386&lt;BR /&gt;&lt;BR /&gt;[root@station1 ~]# cat /etc/redhat-release&lt;BR /&gt;Red Hat Enterprise Linux Server release 5.4 (Tikanga)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;However i am still confused if whatever i did was to make the changes for just SFTp and not SCP? Are sftp and scp work differently? If yes then what patch should i imply for the changing UMASk for scp transactions?</description>
      <pubDate>Mon, 28 Jun 2010 10:46:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652978#M41319</guid>
      <dc:creator>Jhingan</dc:creator>
      <dc:date>2010-06-28T10:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: my umask doesnt work when doing scp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652979#M41320</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] Are sftp and scp work differently?&lt;BR /&gt;&amp;gt; [...]&lt;BR /&gt;&lt;BR /&gt;They're spelled differently for a reason.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] If yes then what patch should i imply&lt;BR /&gt;&amp;gt; [...]&lt;BR /&gt;&lt;BR /&gt;I have no idea.  I didn't even know about the&lt;BR /&gt;patch for SFTP.&lt;BR /&gt;&lt;BR /&gt;Have you considered using SFTP instead of&lt;BR /&gt;SCP?</description>
      <pubDate>Mon, 28 Jun 2010 12:11:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652979#M41320</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-06-28T12:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: my umask doesnt work when doing scp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652980#M41321</link>
      <description>So i given a try trasnferring files using sftp. For sftp trasnactions the umask works fine but for scp the issue remains the same. Can anyone on this forum help me with setting up a defalu permission on scp transactions please?</description>
      <pubDate>Tue, 29 Jun 2010 10:35:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652980#M41321</guid>
      <dc:creator>Jhingan</dc:creator>
      <dc:date>2010-06-29T10:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: my umask doesnt work when doing scp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652981#M41322</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;Welcome to ITRC.&lt;BR /&gt;&lt;BR /&gt;Yes sftp and scp work differently. It is not totally unreasonable for one to expect openssh, which includes ssh,sftp and scp to work consistently. By default, they use the user profile, including umask.&lt;BR /&gt;&lt;BR /&gt;But in this case, probably due to security concerns they do not work the same way. The other Steven may be trying to make this point to you.&lt;BR /&gt;&lt;BR /&gt;To impact the scp permissions the way you have sftp permissions, a new rpm or software and sshd_config configuration will likely be required.&lt;BR /&gt;&lt;BR /&gt;To find out about scp umask, I recommend reading the following search:&lt;BR /&gt;&lt;A href="http://www.google.com/search?q=scp+umask+for+openssh&amp;amp;ie=utf-8&amp;amp;oe=utf-8&amp;amp;aq=t&amp;amp;rls=org.mozilla:en-US:official&amp;amp;client=firefox-a" target="_blank"&gt;http://www.google.com/search?q=scp+umask+for+openssh&amp;amp;ie=utf-8&amp;amp;oe=utf-8&amp;amp;aq=t&amp;amp;rls=org.mozilla:en-US:official&amp;amp;client=firefox-a&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I read a few of the links and found no solution.&lt;BR /&gt;&lt;BR /&gt;Your profile....&lt;BR /&gt;I have assigned points to   0  of   4  responses to  my questions.&lt;BR /&gt;&lt;BR /&gt;May want to do something about that.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 29 Jun 2010 13:25:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/my-umask-doesnt-work-when-doing-scp/m-p/4652981#M41322</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2010-06-29T13:25:39Z</dc:date>
    </item>
  </channel>
</rss>

