[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tramp: changing umask?

From: egarrulo
Subject: Re: Tramp: changing umask?
Date: Thu, 9 Jun 2016 00:44:04 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

On 09/06/16 00:21, Nick Dokos wrote:
egarrulo <address@hidden> writes:

On 08/06/16 21:37, egarrulo wrote:
On 08/06/16 17:20, Barry Margolin wrote:
In article <address@hidden>,
egarrulo <address@hidden> 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
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.

I have tried doing so, but it hasn't worked. I am working with a remote
web host and I don't know much about the environment.

I have found that I can run "chmod 0644" on files, therefore
if there were a way to run this command after saving a file via Tramp,
that would could be a way to solve the problem, I think.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]