R
R
Ramsei2013-01-03 01:27:34
linux
Ramsei, 2013-01-03 01:27:34

sftp access to site directories

Server on debian 6, nginx, php-fpm.
There are 12 sites on the server in the directories /home/hosting/site1,2,3, etc.
all sites under different users, the rights are 700.

There was a need to give rights to the developer so that he could upload files to the directory of one of the sites, created the user devsite1 with the home directory /home/hosting/site1, assigned a password, for chroot-til, in /etc /ssh/sshd_config wrote the following:
Match User devsite1
ChrootDirectory %h
AllowTCPForwarding no
X11Forwarding no
ForceCommand internal-sftp

The problem is that it does not connect under this user to any via SFTP (writes the Server unexpectedly closed network connection error), it connects only if the owner of the site directory /home/hosting/site1 is made the owner of root-a and the root group. Tell me how to properly organize such access and give rights so that the user devsite1 can upload files.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
A
Andrey Shiryaev, 2013-01-03
@Claud

As far as I remember, the chroot directory must be owned by root. Make a simple nested directory and assign the user you need to it.

V
Vlad Zhivotnev, 2013-01-03
@inkvizitor68sl

debian.pro/24

V
Victor Glembitsky, 2013-01-03
@Iforgot

The directory is written with an "I". Isn't it easier to install an ISP type panel or analogues? Such leapfrog with the rights otherwise will be all the time. Either one or the other.

C
ComodoHacker, 2013-01-03
@ComodoHacker

What's in auth.log?

S
sonic, 2013-01-03
@sonic

proftpd and virtual user

S
Stanislav, 2013-11-26
@delfi

I encountered it myself now
http://wiki.enchtex.info/howto/ssh_sftp
In /var/log/secure it was just written about fatal: bad ownership or modes for chroot directory
Configured as per the link and everything works

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question