<div dir="ltr">This might be helpful. Basically you create a mini environment for the user, then on login the user is restricted to only that environment in terms of scope (they don't 'see' the rest of the server's filesystems).<div>
<br></div><div><a href="http://www.thegeekstuff.com/2012/03/chroot-sftp-setup/">http://www.thegeekstuff.com/2012/03/chroot-sftp-setup/</a><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 30, 2014 at 4:19 PM, Amit Nepal <span dir="ltr"><<a href="mailto:amit@amitnepal.com" target="_blank">amit@amitnepal.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>A while back, I had done this to
restrict to a particular directory , but it may not be ideal for
you as you already have some parent directories, but you can give
a try :<br>
<br>
<a href="http://www.amitnepal.com/chrooting-users-with-sftp/" target="_blank">http://www.amitnepal.com/chrooting-users-with-sftp/</a><br>
<br>
Or , you may be able to mount that directory somewhere else and
give access like this :<br>
<a href="http://www.amitnepal.com/ftp-access-to-files-outside-base-directory/" target="_blank">http://www.amitnepal.com/ftp-access-to-files-outside-base-directory/</a><br>
<br>
Just look at this part : <br>
<p><code>mkdir /home/username/extraaccess</code></p>
<p><code>mount --bind /folder/to/grant/access/
/home/username/extraaccess</code></p>
<br>
Thanks<br>
<div><b>Amit K Nepal<br>
Chief Information Officer
<br>
(RHCE, CCENT, C|EH, C|HFI, GIAC ISO 27000 Specialist)<br>
omNovia Technologies Inc.
</b></div>
On 4/30/2014 3:54 PM, keith smith wrote:<br>
</div>
<blockquote type="cite">
<div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:12pt">
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br>
<span></span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><span>Hi I'm using CentOS
6.5 and we use the users home dir + "public_html" as the
docroot for our websites like this:</span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br>
<span></span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><span>/home/user_name/public_html</span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br>
<span></span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><span>We are using SSH for
SFTP. Each host has only one SFTP user.</span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br>
<span></span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><span>What I need to do is
add a directory, lets call it uploads like this: </span><br>
<span></span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><span><br>
</span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><span>/home/user_name/public_html/uploads
<br>
</span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br>
<span></span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><span>Any content in
uploads must be accessible to Apache so it can be displayed.</span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br>
<span></span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><span>And I would like to
add a user that can only access </span><br>
<span>/home/user_name/public_html/uploads
and would be able to add/edit/remove any files in just the
uploads directory.</span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br>
<span></span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><span>I thought of a link,
however that did not work.</span><span> I
created a user uploads which created a home dir
/home/uploads and I tried to link that to
/home/user_name/public_html/ which created </span><br>
<span>/home/user_name/public_html/uploads .
This did not work.</span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br>
</div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal">I hope this makes sense. <br>
</div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br>
<span></span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><span>Any suggestions?<br>
</span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br>
<span></span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><span></span><span>Thanks in advance!!</span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><span> <br>
</span></div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal">Keith</div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br>
</div>
<div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>---------------------------------------------------
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a>
To subscribe, unsubscribe, or to change your mail settings:
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a></pre>
</blockquote>
<br>
</div>
<br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>---<br>Ben <br>
<br><font size="1"><span style="border-collapse:separate;color:rgb(0,0,0);font-family:arial narrow,sans-serif;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span>python -c "exec(\"import math\\nprint ''.join(map(lambda x: chr(x), ( (ord('a')-(3*5)), int(math.sqrt(math.pi*76)*5+2), int(math.ceil(math.e)*28), int(math.floor(math.e)*35), long(abs(4%3*35+3)*2))))\")"</span></span><i><font style="font-family:comic sans ms,sans-serif"><font style="font-family:arial narrow,sans-serif"></font></font></i></font><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;text-align:left;line-height:130%">
</div><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%"></div>
</div>