Apache MINA SSH shell session - List of available commands

140 views Asked by At

I am working with Apache MINA SSHD (Backend) and Javascript (frontend) to make a terminal on the browser that connects to the SSHD on the server and create an SSH connection.

This is working fine and smooth. However I am asked to filter the available commands for the user to use only some specific commands (there are many commands, so a script solution doesn’t work for me like this one).

  1. I was thinking about a cache variable that controls the input that the user has wrote, but I am not sure of how to implement this.
  2. Another thing that occured to me was to check if there is a way of defining the available commands with the pty flags?

Any ideas of how to save the current command on a variable for later on checking the command and filter it on is welcome!

Context: The connection between the frontend and the backend is created using web sockets, we send the input from the frontend directly to the websocket to the backend and the backend recieves the input and sent it to the input stream of the SSH object.

0

There are 0 answers