Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Great tip!

Setting umask when default shell is not bash or ksh

We are running Solaris with OpenSSH and the default shell for our users is csh. We tell users to put an
exec /path/to/their/favorite/shell

in thier .login file. This way, we can configure the environment in csh and don't have to worry about different shell config file formats while essentially allowing users to choose their own shell.

Anyway, WinSCP worked fine as long as users specified thbe path to bash in the WinSCP preferences. The problem occured when a new directory was created. The "create new directory" command always created a directory with the permissions of rwxrwxrwx (777). However, uploaded files, or directories were created with a umask of 022 (resulting in file or directory permissions of 644 or 755 rerspectivly). We identified the problem at login time. What happened is that since the process started out as csh, and then changed to bash, bash did not see itself as an interactive shell and did not read any config files (system or user) which would set its umask to 022.

The solution we came up with was to put the line: :idea:
umask 022

in our init.d right before sshd is started. This way sshd's umask was 022 and any processes it spawned also had a umask of 022.

If you have any questions, feel free to contact me at <> or post them here.