LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   SFTP chrooted (https://www.linuxquestions.org/questions/linux-software-2/sftp-chrooted-4175520620/)

ratotopi 09-30-2014 12:23 PM

SFTP chrooted
 
Hi

I have create chrooted sftp. The user john has chrooted directory /chroot/home/john and in /etc/passwd his home directory is only /sftp so that when he sftp to the server it takes him directly to /chroot/home/john/sftp directory where he can execute all the user command which he would not have been able to execute in /chroot/home/john. What I want to achieve is even when john execute any command with / in front I want the directory to be /chroot/home/john/sftp not /chroot/home/john. Example executing mkdir /test I want the directory to be created inside /chroot/home/john/sftp/ it should not try to create inside /chroot/home/john which is not possible because of chrooted home directory. Thank you for any new idea you have in solving this problem.

spanik 10-01-2014 04:35 AM

Maybe obvious but...

CHROOT John to /chroot/home/john/sftp and set John's home directory in /etc/passwd to / instead of /sftp

ratotopi 10-01-2014 11:46 AM

NO that won't work, when you chroot /chroot/home/john/sftp the directory has to be owned by root and the chmod cannot be more than 755. John will not be able to create any file when he login.


All times are GMT -5. The time now is 02:48 AM.