From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nick Dokos Newsgroups: gmane.emacs.help Subject: Re: Tramp: changing umask? Date: Wed, 08 Jun 2016 18:21:38 -0400 Message-ID: <87r3c7coel.fsf@alphaville.usersys.redhat.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1465424554 29004 80.91.229.3 (8 Jun 2016 22:22:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 8 Jun 2016 22:22:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 09 00:22:25 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bAlrj-0006xc-Ho for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Jun 2016 00:22:23 +0200 Original-Received: from localhost ([::1]:59771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAlri-0005XS-P3 for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Jun 2016 18:22:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAlrE-0005XG-Qp for help-gnu-emacs@gnu.org; Wed, 08 Jun 2016 18:21:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAlr9-0006Zt-QG for help-gnu-emacs@gnu.org; Wed, 08 Jun 2016 18:21:51 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:39780) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAlr9-0006Zk-J0 for help-gnu-emacs@gnu.org; Wed, 08 Jun 2016 18:21:47 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bAlr8-0006YT-1m for help-gnu-emacs@gnu.org; Thu, 09 Jun 2016 00:21:46 +0200 Original-Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 Jun 2016 00:21:46 +0200 Original-Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 Jun 2016 00:21:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 41 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nat-pool-bos-t.redhat.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:7iCvi1B3xET6RGlqbeIJ3CndT/Y= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110382 Archived-At: egarrulo writes: > On 08/06/16 21:37, egarrulo wrote: >> On 08/06/16 17:20, Barry Margolin wrote: >>> In article , >>> egarrulo wrote: >>> >>>> When I create a file with C-x C-f (ido-find-file) in Tramp, Tramp >>>> creates the file with 0664 permissions instead of 0644 permissions. >>>> >>>> Here is the relevant configuration: >>>> >>>> (setq tramp-default-user "myuser") >>>> (require 'tramp) >>>> >>>> How can I make Tramp create new files with 0644 permissions? Thanks. >>> >>> It sounds like the target user's umask is different from your umask. >> >> Thanks for your suggestion. Indeed the user's umask is 0002, which >> explains >> the 0664 permissions. Can I change the umask from Tramp before >> creating/saving files? > > I have tried to connect with SSH, running the command: > > umask 0022 > > then disconnecting and connecting again, but umask was 0002 again. That's correct: umask is set for a shell session through an init file (.bash_profile, /etc/profile or similar) and it persists only for that session. I don't know if there is a tramp way of doing it, but you can certainly do what you want by adding umask 022 to the shell initialization file of the user on the remote host. -- Nick