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 ?
Introduction. The Session is at the heart of MINA : every time a client connects to the server, a new session is created on the server, and will be kept in memory until the client is disconnected. If you are using MINA on the client side, every time you connect to a server, a session will be created on the client too.
Apache MINA (Multipurpose Infrastructure for Network Applications) is an open source Java network application framework. MINA can be used to create scalable, high performance network applications. MINA provides unified APIs for various transports like TCP, UDP, serial communication.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With