Thank you @Lyor, that was so much more simple than the rabbit hole I was going down earlier - I was extending ProcessShellFactory and trying to create my own command.
This way was pretty simple, and a not so bad way to reuse your code in the end. Especially at this stage - I'll see what I can do with it and whether I need to get in deeper. As it stands, I can offer the shell based on a user, or reject it. Just what I wanted at this stage. If I've not take too much of your time already. How do you recommend that I reject a shell? At the moment, I just threw an Unchecked exception - it works, but I'm not sure if I should do something else for 'niceness' sake. I'll play around with it anyway, and see how I get on. Thanks again for your time and hints. I'm trying to get deeper into Java and this was a nice challenge - even if you had to push me into the right direction! Regards, Adam. On Sun, 5 May 2019 at 18:25, Lyor Goldstein <lgoldst...@apache.org> wrote: > >> Is there a simple way to set up a command like this? I was wondering > if I can use the InvertedShellWrapper or if those thoughts mean I am going > off at a tangent!? > > No, you're on the right track - although sadly there is no simple way. I > would recommend you extend InteractiveProcessShellFactory and then override > its createInvertedShell to return (again) a class derived > from ProcessShell that overrides "start" and implements the restriction you > decided. > > As of SSHD-913 and version 2.3.0 (when they are released) it will be > simpler, though not "simple"... >