# sftp chroot does not honor umask - how to fix?



## rainer_d (Aug 27, 2012)

Hi,

I have setup users with sshd's ChrootDirectory and additionally have setup Subsystem internal-sftp for sftp-chroot.
When I login with ssh, the umask (setup via a special class in login.conf works.
When I login via sftp, it does not work, files are still only writable by the current user (should be group-writable)

Why is this?
I tried copying the login.conf* files from /etc into the chrooted etc, but that did not help, either.


----------



## anomie (Aug 28, 2012)

sftp-server(8) has a -u option for specifying umask. AFAIK, that option does not work with internal-sftp. (I don't know of a good "fix" for this one.)


----------



## rainer_d (Aug 28, 2012)

anomie said:
			
		

> sftp-server(8) has a -u option for specifying umask. AFAIK, that option does not work with internal-sftp. (I don't know of a good "fix" for this one.)



I have read about the -u option.
Maybe I should give it a try. After all, I've got a full chroot there with /dev and /etc.
So the chroot should also work with sftp-server.


----------

