Chroot directory limit user to sftp folder -


my current setup works: sshd_config file:

subsystem sftp internal-sftp  match group filetransfer2     chrootdirectory %h     x11forwarding no     allowtcpforwarding no     forcecommand internal-sftp 

linux commands ran:

addgroup --system filetransfer usermod -g filetransfer username chown root:root /home/username chmod 755 /home/username cd /home/username mkdir docs public_html chown username:filetransfer * 

and username restricted /home/username folder , works perfectly. try limit username to: /home/somefolder/public/domain.com/

when use sudo usermod --home username /home/somefolder/public/domain.com/ changes default directory of username when logged in sftp. although refuses login. i've tried above steps while using /home/somefolder/public/domain.com/ without luck, refuses login sftp.

i have give support desk sftp login , don't want give them root login details , therefor want limit them domain.com folder.

what doing wrong?

thanks

for chroot work did earlier, have force root owner of directory , files/directories inside directory may owned user.

for requirement work need create separate directory trees. example: user1: /srv/www/user1/ user2: /srv/www/user2/

in above example, force root owner of /srv/www/user1 & /srv/www/user2 , individually make both users owner of inside ~/user1/* & ~/user2/*.

this have done earlier if need multiple users chroot jail configuration, required give separate trees under forced root owned directory.

hope help!


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -