I am trying to do an SSH connection to a clish and then execute a command. The SSH node expects a working directory to be specified, however because it is a clish, cd is not allowed and an error is returned.
Is it possible to make the Working Directory optional?
I tried that suggestion and it works! Thank you! Another solution is to put the Working Directory as an expression and then leave empty, it work too.
When I execute a command I receive an error āFailed in tcgetattr(). : Inappropriate ioctl for deviceā and with some research found out that an argument -tt in the ssh command will work (for example ssh -tt[email protected]ā¦). Is it possible to put arguments in the ssh node?
What SSH sever implementation are you working with? Adding support for forcing tty allocation sounds like a bad idea to me as it will cause issues. When you force tty the session wonāt know how to handle interactive responses (password prompts, confirmation dialogs) so it will just sit there connected waiting.
A better solution for this one is to mark the working directory as optional as previously mentioned. As for when it would be implemented and if it is possible⦠It is possible to add it but timelines depend on the popularity of the request although if we are working on a node anyway we may pull in some of the feature requests.
I do have a ticket opened to look into an issue with the SSH node so I can try and fit this in at the same time but it will likely be a few weeks until I get there.
What I am trying to do is execute a specific command in an interactive shell (āclishā shell).
For instance, Iām trying to run the command ssh -t [email protected] address āvpn tu del vpn_ip usernameā. This vpn command is a checkpoint shell that allows you to block vpn communications.
The vpn command cannot be executed without the -t parameter because ssh node does not open a normal shell.
Normally with an interactive option you would want to interact with a response which is not something that is currently possible with n8n as we open the session fire off the command then close it rather than waiting for user input so using the example you have provided if we were to enable the force tty option and you just ran the vpn command it would just stay there waiting for an input that will never happen.
It sounds like from your previous testing not having a working directory set would allow you to run the command and clish would be able to build out the paths as needed from itās environment files. If this option wonāt work for you though it will likely take longer to check if it is possible as we would need to check the package we use to see if it supports the option and do some testing to make sure it wonāt lead to any unexpected issues.
As the feature request is open though it will just be a case of waiting until we have some resource to assign to this one, As a temporary solution depending on how you have n8n configured you could SSH to the host running n8n then SSH from there to the clish session.