Re: SCP umask and def. modes

From: Richard E. Silverman (
Date: 01/07/03

From: (Richard E. Silverman)
Date: 06 Jan 2003 23:46:01 -0500

>>>>> "JW" == Jim Williams <> writes:

    JW> The clients are using pscp ver 0.53b. I wonder if the version has
    JW> anything to do with this though. Does a SCP connection use the
    JW> bash shell or not? If not then all the shell start up scripts in
    JW> the world will have no effect. I've seen no effect so far. If
    JW> the sshd doesn't use a shell to create the files, does the
    JW> protocol provide a way to define the mode?

OpenSSH sshd uses the target account's shell to start all programs on
behalf of the user. However, if you read the INVOCATION section of the
bash man page, you will find that if bash is started as "sh" in
non-interactive non-login mode (as in this case), it does not read any
startup files. It is documented that if started as "bash", it will read a
file named by the environment variable BASH_ENV, so you should be able to
use that by setting the shell to "/bin/bash" instead of "/bin/sh", and
setting BASH_ENV in ~/.ssh/environment. However, I can't get bash to
actually do what's documented; it never seems to read the file.

If you change the shell to (t)csh and set the umask in ~/.cshrc, then it
works fine.

  Richard Silverman

Relevant Pages