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

SSH KB ♦
509249246237


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
BASH_ENV=$HOME/.profile

-- $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:
UMASK=077



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.

link

answered Dec 29 '10 at 20:05

SSH%20KB's gravatar image

SSH KB ♦
509249246237

edited Aug 16 '11 at 22:19

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

Joe - Tectia Support ♦♦
51714

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×20
×2
×1

Asked: Dec 29 '10 at 20:04

Seen: 3,937 times

Last updated: Aug 16 '11 at 22:19

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