6

Am using Apache MINA SSHD to build my own custom SFTP Server.

I want to limit the file system my user sees. I just want them to see the directory structure under /aa/bb/cc

I do not want them to be able to see or navigate any other folder.

And from the directories under /aa/bb/cc, a user will have read access to some directories and write access to only a selected few. How do I achive this ?

f_puras
  • 2,521
  • 4
  • 33
  • 38
Swaroop Rath
  • 141
  • 1
  • 4

1 Answers1

2

The FileSystemView has been introduced for that very purpose. If you're using version 0.14.0, the following will work:

 sshServer.setFileSystemFactory(new VirtualFileSystemFactory(new File("admin").getAbsolutePath()));

I have also almost got a working example here. I just have to figure out how to set the home directory dynamically.

Community
  • 1
  • 1
Hooli
  • 1,135
  • 3
  • 19
  • 46