SFTP linux centos 7

Issues related to applications and software problems
Post Reply
markgp71
Posts: 1
Joined: 2022/11/16 22:23:26

SFTP linux centos 7

Post by markgp71 » 2022/11/16 22:34:12

Hi I have a problem.

I configured a sftp user "sftp_user1" and a group "sftp_users", I also configured my /etc/ssh/sshd_config and everything is OK, but in another example I have this:

nginx : nginx /var/www/site1/documents/

I want to make this path the /home/ directory for sftp users via chroot in /etc/ssh/sshd_config, I already changed the home directory of my user

usermod -d /var/www/site1/documents/

My problem is that I can´t connect to this path because the propietary and group is nginx not root nither sftp_user1 and my question is is it possible to do this? make the "home" directory with chroot for sftp users a path that the propietary is another user and group?

obviusly it´s not possible for my job to change the propietary of that path,


thank you so much!.

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: SFTP linux centos 7

Post by TrevorH » 2022/11/17 17:07:10

Openssh is extremely fussy about the permissions on the paths leading down to the chroot directory. It will refuse to allow connections if anything is not as it should be but it should also log the reason why to /var/log/secure. I found https://wiki.archlinux.org/title/SFTP_chroot which looks like a goodish write up of what you can and cannot do.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply