login about faq

We need instructions for setting the default file attributes for transferred files

asked Dec 29 '10 at 20:04

SSH%20KB's gravatar image


The default file attributes for created files are defined in the shell initialisation files with umask on the server side. The definitions need to be made in a shell initialization file that is read even in a non-interactive login. Note that scp2 and sftp2 always use the shell on the remote side non-interactively. The correct initialization file and the location varies depending on the shell used on the server-side.

For example, when using zsh, the umask definition should be added to either /etc/zshenv or $HOME/.zshenv files because they are read on every invocation of the shell. Note that zsh /etc/zshrc is read only for interactive shells and thus in this case is not useful.

When using bash shell, you have to set BASH_ENV in /etc/environment to point to file where umask is set:

-- /etc/environment

-- $HOME/.profile umask 022

You can also use the environment or login file alone:

The ssh-servant-g3 process will open and read the /etc/environment, /etc/default/login and /home/user/.ssh2/environment files if they exist.

The first two are not typically found on HP-UX but you can create /etc/environment (or /home/user/.ssh2/environment files) that contain the line UMASK=<umask>.

For example:

Note that before 6.0.2 the UMASK entry in /etc/environment was not used.

Please refer to your shell's documentation for further information.


answered Dec 29 '10 at 20:05

SSH%20KB's gravatar image


edited Aug 16 '11 at 22:19

Joe%20-%20Tectia%20Support's gravatar image

Joe - Tectia Support ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Dec 29 '10 at 20:04

Seen: 5,548 times

Last updated: Aug 16 '11 at 22:19

All user contributed content licensed under the cc-by-sa license.
Powered by OSQA.