{"id":608,"date":"2016-09-21T11:54:37","date_gmt":"2016-09-21T15:54:37","guid":{"rendered":"http:\/\/easy-admin.ca\/?p=608"},"modified":"2016-09-28T21:01:05","modified_gmt":"2016-09-29T01:01:05","slug":"centos-prevent-root-browsing-with-sftp","status":"publish","type":"post","link":"https:\/\/easy-admin.ca\/index.php\/2016\/09\/21\/centos-prevent-root-browsing-with-sftp\/","title":{"rendered":"Prevent new user to browse your CentOS server using sFTP"},"content":{"rendered":"<p><em><strong>Good day!<\/strong> <\/em>I run into a problem yesterday that allowed a new created account to navigate my entire CentOS server when connecting using <strong>sFTP protocol<\/strong>. Here is the step by step guide to fix this major problem in CentOS\/Webmin\/VirtualMIN.<\/p>\n<ol>\n<ol>\n<li>Create a new account in VirtualMIN \/ <strong>Ex. mynewwebsite.com<br \/>\n<\/strong>After you created the new account you will have to set things up so that when this new account user connect to your sFTP (I use proFTPD) they will not be able to navigate your entire server.<\/li>\n<\/ol>\n<\/ol>\n<p><strong>NOTE:<\/strong> You will have to create a new UserGroup : sftpusers<\/p>\n<p>In webmin, navigate to this section \/Others\/File Manager\/ Once you are there select the new created account<\/p>\n<p><strong>\/home\/mynewwebsite<\/strong><\/p>\n<h4><span style=\"color: #ff0000;\"><strong>You will have to do 3 more steps<br \/>\n<\/strong><\/span><\/h4>\n<ol>\n<li>CHOWN the new created directory to ROOT<br \/>\n<strong>NOTE :<\/strong> Do not use recursive!<\/li>\n<li>You have to set now the directory permissions to 0755<\/li>\n<li>Run this command in Shell # usermod -G sftpusers <strong>USERNAME<\/strong><\/li>\n<\/ol>\n<p><a href=\"http:\/\/easy-admin.ca\/my_uploads\/2016\/09\/proftpd-root-01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-618\" src=\"http:\/\/easy-admin.ca\/my_uploads\/2016\/09\/proftpd-root-01.jpg\" alt=\"proftpd-root-01\" width=\"856\" height=\"416\" srcset=\"https:\/\/easy-admin.ca\/wp-content\/uploads\/2016\/09\/proftpd-root-01.jpg 856w, https:\/\/easy-admin.ca\/wp-content\/uploads\/2016\/09\/proftpd-root-01-300x146.jpg 300w, https:\/\/easy-admin.ca\/wp-content\/uploads\/2016\/09\/proftpd-root-01-768x373.jpg 768w\" sizes=\"auto, (max-width: 856px) 100vw, 856px\" \/><\/a><\/p>\n<p><strong>NOTE :<\/strong> This will add your new created account to the sFTPusers group!<\/p>\n<p>After this your new created account will only have permission to navigate into the directory \/home\/mynewwebsite\/ when connecting with <strong>sFTP<\/strong>.<\/p>\n<p><strong><em>Enjoy!<\/em><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Good day! I run into a problem yesterday that allowed a new created account to navigate my entire CentOS server when connecting using sFTP protocol. Here is the step by step guide to fix this major problem in CentOS\/Webmin\/VirtualMIN. Create a new account in VirtualMIN \/ Ex. mynewwebsite.com After you created the new account you &hellip; <a href=\"https:\/\/easy-admin.ca\/index.php\/2016\/09\/21\/centos-prevent-root-browsing-with-sftp\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Prevent new user to browse your CentOS server using sFTP<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":609,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-608","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/posts\/608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/comments?post=608"}],"version-history":[{"count":0,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/posts\/608\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/media\/609"}],"wp:attachment":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/media?parent=608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/categories?post=608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/tags?post=608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}