all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Tramp: changing umask?
Date: Wed, 08 Jun 2016 18:21:38 -0400	[thread overview]
Message-ID: <87r3c7coel.fsf@alphaville.usersys.redhat.com> (raw)
In-Reply-To: drriibFjtl3U1@mid.individual.net

egarrulo <egarrulo@gmail.com> writes:

> On 08/06/16 21:37, egarrulo wrote:
>> On 08/06/16 17:20, Barry Margolin wrote:
>>> In article <drq6pqFb3dsU1@mid.individual.net>,
>>>   egarrulo <egarrulo@gmail.com> 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




  reply	other threads:[~2016-06-08 22:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-08  9:28 Tramp: creating new files with 0644 permissions rather than 0664? egarrulo
2016-06-08  9:32 ` egarrulo
2016-06-08 15:20 ` Barry Margolin
2016-06-08 19:37   ` Tramp: changing umask? egarrulo
2016-06-08 20:33     ` Barry Margolin
2016-06-08 21:55     ` egarrulo
2016-06-08 22:21       ` Nick Dokos [this message]
     [not found]       ` <mailman.1173.1465424514.1216.help-gnu-emacs@gnu.org>
2016-06-08 22:44         ` egarrulo
2016-06-09  6:43           ` Michael Albinus
     [not found]           ` <mailman.1187.1465454639.1216.help-gnu-emacs@gnu.org>
2016-06-09  8:47             ` egarrulo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r3c7coel.fsf@alphaville.usersys.redhat.com \
    --to=ndokos@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.