I want to grant a (remote support) user SSH or SFTP access to the /var/www/html folder (and all sub-folders) on my system. I don't want them to have access outside this directory. As well, the ownership of the directories and files in this directory do not match the new user, and I don't want to change the permissions.
This similar question involves setting up a NEW directory with permissions matching the new user. That's not what I want; I must limit them to an existing directory. This similar question is close but assumes I can chown the directory to root, which I cannot as apache will fail.
I know how to create a linux user, and I know how to change file/dir permissions, and I understand the concept of chroot. Just can't figure out how to combine these.
UPDATE: A workarounds seems to be to create a regular SFTP setup and home directory for the user, them mount the desired (target) directory into a subdir of the users home dir, as shown in this post
If there is a better/proper way please post an answer.
sshorsftp? Ifssh, they'd also need access to the shell and whatever command they need to use over ssh.sftp chrootshould point you in the right direction./var/www/html?