3

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 ?

masegaloeh
  • 17,978
  • 9
  • 56
  • 104
Olaf
  • 89
  • 2
  • 3
  • 7
  • The chroot directory should not be /var/www, rather /var/www/sftp or some such which you then give the proper read/write permissions to for the SFTP user/group. – Daniel Mar 03 '15 at 17:13

1 Answers1

6

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.

faker
  • 17,326
  • 2
  • 60
  • 69