Mike Leone via plug on 22 Sep 2026 12:36:31 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] chroot perms confusion


Yeah, I'm an idiot ...

>
> Match Group sftpusers
>         ChrootDirectory %h
>         ForceCommand internal-sftp
>         AllowTcpForwarding no
>         X11Forwarding no
>

I had mistyped the "%h:" above, so it said "&h".  That was after I had
started the email ...

Also, I had forgotten that the jail would be their home folder (so
/ftp-area/staples), which means that this folder HAD to be "chown
root:root" and "chmod 755".
Then it worked.

Since the jail is NOT writeable, I had to make a new folder - uploads
- and set that "chown staples:sftpusers" and "chmod g+w uploads".

THEN I was able to SFTP in, and upload files, but ONLY in the uploads folder.

That's a different than where they're uploading now (now, no chroot
jail, so they just upload straight into their home folder, no need of
an "uploads" folder, since their whole home folder is writeable, since
there's no chroot jail).

So that's progress, I guess. We can probably dictate this to the
external users. Heck, the server name and SSH key is changing, why not
the upload location? LOL

If anyone knows how I can get the users to start in the "uploads"
folder, as soon as the SFTP in, rather than having to do a "cd
uploads", I'm all ears ...
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug