Set umask for remote commands

capistrano

Solution

I was confronted to the same issue and got around it by using the then-undocumented `SSHKit.config.umask` in `config/deploy.rb`. Note that this will set the `umask` for every ssh command.

Problem

How can I direct processes started on remote machines via ssh to run with a certain umask? I want this to apply to commands run as part of standard Capistrano recipes too, so I can't just make an explicit call to "umask" part of the command. It does not appear that ~/.bash_profile on the remote machine is read, with the way that Capistrano invokes remote commands.

Original source

Related problems