Quantcast
Channel: BetaArchive
Viewing all articles
Browse latest Browse all 70053

Re: SFTP Restrict folder access

$
0
0
In Forum: Web Design/Programming Support and Discussion
By User: vvb

No you're not.
Also it's impossible (AFAIK) to do what mertz3hack wants to.

I don't think it's impossible. Just follow these directions:
http://www.techrepublic.com/blog/openso ... tories/229

I tried it myself, and this is what it looks like:

BEFORE
user can read files outside his home directory

C:\Program Files (x86)\PuTTY>psftp 10.0.0.1
login as: test
Using keyboard-interactive authentication.
Password:
Remote working directory is /home/test
psftp> pwd
Remote directory is /home/test
psftp> ls
Listing directory /home/test
drwxr-xr-x 4 test test 4096 Jan 26 00:55 .
drwxr-xr-x 7 root root 4096 Dec 11 21:29 ..
-rw-r--r-- 1 test test 3184 Jul 21 2012 .bashrc
drwx------ 3 test test 4096 Jan 25 16:37 mail
psftp> cd /
Remote directory is now /
psftp> ls
Listing directory /
drwxr-xr-x 21 root root 4096 Jul 19 2012 .
drwxr-xr-x 21 root root 4096 Jul 19 2012 ..
drwxr-xr-x 2 root root 4096 Jul 21 2012 bin
drwxr-xr-x 3 root root 4096 Dec 29 00:33 boot
drwxr-xr-x 15 root root 3000 Dec 29 00:33 dev
drwxr-xr-x 82 root root 4096 Jan 26 00:53 etc
drwxr-xr-x 7 root root 4096 Dec 11 21:29 home
lrwxrwxrwx 1 root root 28 Jul 19 2012 initrd.img
drwxr-xr-x 12 root root 12288 Dec 29 00:32 lib
drwx------ 2 root root 16384 Jul 19 2012 lost+found
drwxr-xr-x 3 root root 4096 Jul 19 2012 media
drwxr-xr-x 2 root root 4096 May 7 2012 mnt
drwxr-xr-x 2 root root 4096 Jul 19 2012 opt
dr-xr-xr-x 119 root root 0 Aug 2 13:04 proc
drwx------ 5 root root 4096 Jan 26 00:51 root
drwxr-xr-x 2 root root 4096 Dec 29 00:33 sbin
drwxr-xr-x 2 root root 4096 Jul 21 2010 selinux
drwxr-xr-x 2 root root 4096 Jul 19 2012 srv
drwxr-xr-x 12 root root 0 Aug 2 13:04 sys
drwxrwxrwt 3 root root 4096 Jan 26 00:51 tmp
drwxr-xr-x 11 root root 4096 Sep 22 2010 usr
drwxr-xr-x 15 root root 4096 Jul 21 2012 var
lrwxrwxrwx 1 root root 25 Jul 19 2012 vmlinuz


AFTER:
user is confined to his directory

C:\Program Files (x86)\PuTTY>psftp 10.0.0.1
login as: test
Using keyboard-interactive authentication.
Password:
Remote working directory is /
psftp> pwd
Remote directory is /
psftp> ls
Listing directory /
drwxr-xr-x 4 0 1001 4096 Jan 26 05:55 .
drwxr-xr-x 4 0 1001 4096 Jan 26 05:55 ..
-rw-r--r-- 1 1001 1001 3184 Jul 21 2012 .bashrc
drwx------ 3 1001 1001 4096 Jan 25 21:37 mail
psftp> cd /
Remote directory is now /
psftp> ls
Listing directory /
drwxr-xr-x 4 0 1001 4096 Jan 26 05:55 .
drwxr-xr-x 4 0 1001 4096 Jan 26 05:55 ..
-rw-r--r-- 1 1001 1001 3184 Jul 21 2012 .bashrc
drwx------ 3 1001 1001 4096 Jan 25 21:37 mail
psftp>

Viewing all articles
Browse latest Browse all 70053

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>