{"id":573,"date":"2013-02-05T15:54:33","date_gmt":"2013-02-05T15:54:33","guid":{"rendered":"http:\/\/scunster.co.uk\/?p=573"},"modified":"2013-09-14T08:04:33","modified_gmt":"2013-09-14T08:04:33","slug":"openssh-sftp-ssh","status":"publish","type":"post","link":"https:\/\/scunster.co.uk\/?p=573","title":{"rendered":"OpenSSH &#8211; SFTP &#8211; SSH &#8211; CHRoot \/ Jail a user"},"content":{"rendered":"<p>Just a few usefull commands to help keep a user in a chrooted \/ jail directory, preventing them from viewing any directory outside of their set jail \/ chrooted environment. Very useful in a shared hosting system with sftp \/ ssh enabled<\/p>\n<p>edit the SSH Config<br \/>\n\/etc\/ssh\/sshd_config<\/p>\n<p># SFTP and SSH Access<br \/>\nMatch User YOURUSERNAME<br \/>\n# ChrootDirectory \/var\/www\/vhosts\/USERSDOMAIN\u00a0 # Only use if you wish to restrict user to this directory<br \/>\nX11Forwarding no<br \/>\nAllowTcpForwarding no<br \/>\n# ForceCommand \/usr\/libexec\/openssh\/sftp-server<br \/>\n# ForceCommand internal-sftp<\/p>\n<p># Just SFTP Access<br \/>\nMatch User YOURUSERNAME<br \/>\n# ChrootDirectory \/var\/www\/vhosts\/HOMEDIR # Only use if you wish to restrict user to this directory<br \/>\nX11Forwarding no<br \/>\nAllowTcpForwarding no<br \/>\nForceCommand internal-sftp<\/p>\n<p>Restart the SSH server<br \/>\n\/etc\/init.d\/sshd restart<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just a few usefull commands to help keep a user in a chrooted \/ jail directory, preventing them from viewing any directory outside of their set jail \/ chrooted environment. Very useful in a shared hosting system with sftp \/ ssh enabled edit the SSH Config \/etc\/ssh\/sshd_config # SFTP and SSH Access Match User YOURUSERNAME [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[164,3,170,171,131,12],"tags":[],"class_list":["post-573","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux","category-security","category-security-linux","category-ubuntu-linux","category-webhosting"],"_links":{"self":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=573"}],"version-history":[{"count":5,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/573\/revisions"}],"predecessor-version":[{"id":732,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/573\/revisions\/732"}],"wp:attachment":[{"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scunster.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}