{"id":681,"date":"2021-07-23T12:35:31","date_gmt":"2021-07-23T12:35:31","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/how-to-create-custom-jailed-shell-mounts\/"},"modified":"2021-07-23T12:35:31","modified_gmt":"2021-07-23T12:35:31","slug":"how-to-create-custom-jailed-shell-mounts","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/how-to-create-custom-jailed-shell-mounts\/","title":{"rendered":"How to Create Custom Jailed Shell Mounts"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\"><\/div>\n<hr>\n<h2 id=\"overview\">Overview<\/h2>\n<p>You can create custom jailed shell mounts to let users access additional directories on the server. In cPanel &#038; WHM version 78 and later, you can also allow custom access to files.<\/p>\n<h2 id=\"create-custom-mounts\">Create custom mounts<\/h2>\n<p>You can create custom mounts for files and directories.<\/p>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<p>Custom mounts are <strong>read-only<\/strong> for jailshell users.<\/p>\n<\/p><\/div>\n<\/div>\n<h3 id=\"add-directories-to-a-custom-mount\">Add directories to a custom mount<\/h3>\n<p>To add directories to a custom mount, perform the following steps:<\/p>\n<ol>\n<li>\n<p>Create the <code>\/var\/cpanel\/jailshell-additional-mounts<\/code> file with your preferred editor.<\/p>\n<\/li>\n<li>\n<p>In this new file, add each directory as an absolute directory path on a separate line. For example:\n<\/p>\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">3\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">usr<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">local<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">test1<\/span>\n<span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">usr<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">local<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">test2<\/span>\n<span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">usr<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">local<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">test3<\/span><\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n<p>Do <strong>not<\/strong> use relative paths <strong>or<\/strong> append trailing slashes to the directory names. For more information, read the Specifying paths section below.<\/p>\n<\/p><\/div>\n<\/div>\n<\/li>\n<li>\n<p>Save the file.<\/p>\n<\/li>\n<\/ol>\n<h3 id=\"add-files-to-a-custom-mount\">Add files to a custom mount<\/h3>\n<p>To add files to a custom mount, perform the following steps:<\/p>\n<ol>\n<li>\n<p>Create the <code>\/var\/cpanel\/jailshell-additional-files<\/code> file with your preferred editor.<\/p>\n<\/li>\n<li>\n<p>In this new file, add each file as an absolute directory path on a separate line. For example:\n<\/p>\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">3\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">usr<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">local<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">test1<\/span>.<span style=\"color:#a6e22e\">txt<\/span>\n<span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">usr<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">local<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">test2<\/span>.<span style=\"color:#a6e22e\">txt<\/span>\n<span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">usr<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">local<\/span><span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">test3<\/span>.<span style=\"color:#a6e22e\">txt<\/span><\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n<p>Do <strong>not<\/strong> use relative paths. For more information, read the Specifying paths section below.<\/p>\n<\/p><\/div>\n<\/div>\n<\/li>\n<li>\n<p>Save the file.<\/p>\n<\/li>\n<\/ol>\n<h3 id=\"specifying-paths\">Specifying paths<\/h3>\n<p>You <strong>cannot<\/strong> use relative paths, and you can\u2019t append a trailing slash to the directory names. For example, if you wish to add the <code>\/usr\/local\/test1<\/code> directory, add it in the following format:<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-bash\" data-lang=\"bash\">\/usr\/local\/test1<\/code><\/pre>\n<\/div>\n<p>Do <strong>not<\/strong> enter the path in these formats:<\/p>\n<ul>\n<li><code>test1<\/code> \u2014 This is a relative path.<\/li>\n<li><code>test1\/<\/code> \u2014 This is a relative path and contains a trailing slash.<\/li>\n<li><code>\/usr\/local\/test1\/<\/code> \u2014 This contains a trailing slash.<\/li>\n<li><code>\/usr\/localtest1<\/code> <code>\/usr\/local\/test2<\/code> <code>\/usr\/local\/test3<\/code> \u2014 These are not on separate lines.<\/li>\n<\/ul>\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n<p>If you do <strong>not<\/strong> format the file and directory paths correctly, your server may fail.<\/p>\n<\/p><\/div>\n<\/div>\n<h2 id=\"unmount-a-custom-mount\">Unmount a custom mount<\/h2>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<p>You <strong>cannot<\/strong> remove an entry in the <code>\/var\/cpanel\/jailshell-additional-mounts<\/code> file to unmount a custom mount. To unmount the custom mount, use the <code>umount<\/code> command.<\/p>\n<\/p><\/div>\n<\/div>\n<p>To unmount the <code>\/usr\/local\/example<\/code> directory, run the following command, where <code>username<\/code> represents the cPanel user:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-perl\" data-lang=\"perl\">umount <span style=\"color:#e6db74\">\/home\/<\/span>virtfs<span style=\"color:#e6db74\">\/username\/<\/span>usr<span style=\"color:#e6db74\">\/local\/<\/span>example<\/code><\/pre>\n<\/div>\n<p>The system does <strong>not<\/strong> unmount custom mounts when the user logs out of the jailed shell account.<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Overview You can create custom jailed shell mounts to let users access additional directories on the server. In cPanel &#038; WHM version 78 and later, you can also allow custom access to files. Create custom mounts You can create custom mounts for files and directories. Important: Custom mounts are read-only for jailshell users. Add directories &hellip;<\/p>\n","protected":false},"author":1,"featured_media":682,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/681"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=681"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/681\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/682"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}