开发者

chroot access to www folder

here is the setup

sshd_config:

Match User sftp
    ChrootDirectory /chroot/sftp

I connect just fine to the folder

/chroot/sftp

However I cannot access the website developer folder due to it being outside the scope of the defined chrootdirectory

/usr/lib/apache2/htdocs

How can I access this direct开发者_JAVA百科ory? Is it possible to define the access through sshd_config?


This is exactly the behavior you're asking for when you use chroot. I don't think you can fix this in the sshd_config, but there are two options you might consider:

1) Change Apache's document root so that it lives inside /chroot/sftp. This would be done in your Apache config. 2) Mount the htdocs directory in /chroot/sftp. Something like this:

mount --bind /usr/lib/apache2/htdocs /chroot/sftp

I'm not 100% confident in that command, but the theory is there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜