Centos – SFTP Error: open for write: permission denied

centospermissionssftp

I have created a user and a group only for SFTP and when I try to transfer a file with Filezilla in /var/www I have this error:

Open for write: permission denied

I have configured sshd_config like this :

#Subsystem Sftp /usr/libexec/openssh/sftp-server
Subsystem sftp internal-sftp

Group sftp_only Match
ChrootDirectory /var/www
ForceCommand internal-sftp
X11Forwarding No
AllowTcpForwarding No

/var/www and sub directories are chown root:root and chmod 755

SELinux is disabled.

Any idea ?

Best Answer

The permission of /var/www does not permit the chrooted-user to create files in it.
That is correct and by design.
You must create a folder inside of /var/www with the proper rights of the user.

/var/www can not be writeable for the user.

Related Topic