<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Is anyone aware of anything changing as to how to chroot sftp users on centos 7?</div><div>I have everything setup identically on new server and keep getting</div><div>fatal: bad ownership or modes for chroot di<br>rectory component "/" [postauth]</div><div><br></div><div>Every thing I know root has to own the directory in full path up until chroot directory</div><div><br></div><div>The only way I can even get a sftpuser to connect is if I make them the own of the /home directory</div><div><br></div><div>Old server:   this is in  /home</div><div><br></div><div>drwxr-xr-x  3 root    root    4096 Oct 16 11:15 frontier</div><div><br></div><div>Then, if you go to /home/frontier:</div><div><br></div><div>drwxr-xr-x 3 frontier sftponly 4096 Mar 19 15:45 attachments</div><div><br></div><div>sshd_config:</div><div><br></div><div>Match Group sftponly<br>        ChrootDirectory /home/%u<br>        ForceCommand internal-sftp<br>        X11Forwarding no<br>        AllowTcpForwarding no<br></div><div><br></div><div>New server:   this is in /home</div><div><br></div><div>drwxr-xr-x   4 root    root      38 Mar 26 18:17 frontier</div><div><br></div><div>Then, if you do to /home/frontier:</div><div><br></div><div>drwxr-xr-x 2 frontier sftponly 6 Mar 26 19:05 attachments</div><div><br></div><div>sshd_config has:</div><div><br></div><div>Match Group sftponly<br>        ChrootDirectory /home/%u<br>        ForceCommand internal-sftp<br>        X11Forwarding no<br>        AllowTcpForwarding no</div><div><br></div><div>Only thing different on serves are the UID/GIDs </div><div><br></div><div>Old server for frontier:</div><div><br></div><div>id frontier</div><div><br></div><div>uid=1014(frontier) gid=502(sftponly) groups=502(sftponly)</div><div><br></div><div>New server:</div><div><br></div><div>id frontier</div><div><br></div><div>uid=2043(frontier) gid=1503(sftponly) groups=1503(sftponly)</div><div><br></div><div>Old server, /etc/passwd             frontier:x:1014:502::/attachments:/bin/false</div><div><br></div><div>New server, /etc/passwd           frontier:x:2043:1503::/attachments:/bin/false</div><div><br></div><div>I even tried creating a new group, new user, etc - it's typically straight forward, but I can't get any combination to work that others swear works for them.  This isn't normally difficult but I've been working on this for 4 hours and can't get the right combination to seem to work</div><div><br></div><div>Has anyone successfully gotten this to work on centos 7?</div><div><br></div><div>thanks</div><div><br></div><div><br></div><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div>