On CentOS release 6.5 (Final) I created a restricted user test1
useradd -s /bin/false test1
and configured ssd_config as following
Subsystem sftp internal-sftp
Match User test1
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no
defined home directory for user test1
usermod -d /usr/local/tomcat/webapps/ROOT
then
chown root:root /usr/local/tomcat/webapps/ROOT
chown test1:test1 -R /usr/local/tomcat/webapps/ROOT/*
chmod 755 -R /usr/local/tomcat/webapps/ROOT/*
restarted sshd and tried to log into sftp
# sftp test1@localhost
Connecting to localhost...
test1@localhost's password:
sftp> ls -la
drwxr-xr-x 9 0 0 4096 Feb 16 08:20 .
drwxr-xr-x 9 0 0 4096 Feb 16 08:20 ..
drwxr-sr-x 2 500 501 4096 Feb 6 10:37 META-INF
drwxr-sr-x 6 500 501 4096 Feb 12 14:07 WEB-INF
drwxr-sr-x 2 500 501 4096 Feb 16 08:13 css
drwxr-xr-x 2 500 501 4096 Feb 16 08:27 home
drwxr-sr-x 3 500 501 4096 Feb 12 14:13 images
drwxr-sr-x 2 500 501 4096 Feb 16 00:37 js
sftp> mkdir css/test
Couldn't create directory: Permission denied
I have tried almost everything but still can not figure out why the owner of directory does not have write permission?