Have you tried setting home dirs for your users on the VirtualFileSystemFactory
?

vfsf.setUserHomeDir("the user", the_home_dir);

2018-05-24 15:49 GMT+02:00 Quinn Stevenson <[email protected]>:

> I’m using Mina SSHD (1.7.0) as an embedded SFTP server for unit testing,
> and I’ve come across an issue I can’t figure out.
>
> I’m looking for a way to set the initial directory in a virtual filesystem
> for a user when the login to the SFTP server.
>
> I’m simulating some systems that have not chroot-ed their SFTP users, so
> the initial directory for the user is /home/username, but the users can
> access the entire filesystem (I know - not a good idea, but I didn’t set
> this up).
>
> My problem is that when I setup the SFTP sever using Mina SSHD with a
> VirtualFileSystemFactory, the user is always placed in the “root” directory
> (i.e. / ) when they login.  This makes is really hard for me to simulate
> navigating the virtual filesystem in my tests because the paths are
> different.
>
> Any ideas/suggestions would be greatly appreciated!!
>
> Quinn Stevenson
>
>
>


-- 
------------------------
Guillaume Nodet

Reply via email to