I'm using PHP script and to connect to ssh server. It executes one command and exits. Connection is made to non interactive and non login shell. Because of that it does not load
bash_profile files so I can't set proper
umask there. I googled some information on ssh inner workings and it seems that I can use
~/.ssh/rc file to execute some commands after ssh connection. My
~/.ssh/rcon server I am connecting:
#!/bin/bash echo "Setting umask to 002" umask 002 echo "Umask set"
The problem is that my umask is not set properly. When I run my script and it run
umask command on server i get
0022 umask :
Run: cd /local/web/ && umask > Setting umask to 002 > Umask set > 0022
Why isn't it working?