I am new into n8n , trying to build a basic app where user will request the agent to execute some operational command on juniper router. which tool i need to connect to agent which can ssh the router and execute the command

i am new into n8n , trying to build a basic app where user will request the agent to execute some operational command on juniper router. which tool i need to connect to agent which can ssh the router and execute the command . i tried community node netdevice , ssh connection is established with juniper but got dc right after 10 seconds and no output is received.

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
1 Like

The 10-second disconnect with no output is a classic SSH keep-alive / channel timeout issue on Juniper devices – they’re strict about idle SSH sessions and will drop the connection before your command output comes back if the node doesn’t handle the channel correctly.

Why netdevice drops after 10 seconds:
Juniper routers (especially JunOS) have aggressive SSH session timeouts and they handle interactive shell channels differently from most Linux hosts. The community netdevice node likely isn’t sending keep-alives or isn’t using the “exec” channel type correctly for JunOS.

Better approach for your use case:

Use n8n’s built-in Execute Command node (self-hosted) or the HTTP Request node pointing to a small proxy script. But if you want pure n8n + SSH, try the SSH node that ships with n8n natively (n8n-nodes-base.ssh):

  1. Add an SSH credential with your router IP, username, and password/key
  2. Use the SSH node in “Execute Command” mode
  3. For JunOS, prefix your command with the full path: /usr/sbin/cli -c "show interfaces"

JunOS-specific tip: Juniper drops SSH connections that don’t use the right exec channel. The native n8n SSH node handles this better than most community nodes because it uses exec channels directly.

Timeout fix: In your SSH credential settings, make sure you’re not waiting on an interactive prompt. JunOS will hang waiting for a PTY if the command expects one. Use the non-interactive form:

show route | no-more

(The | no-more flag disables pagination which can cause hangs.)

What JunOS version are you on? Some older versions need specific SSH cipher/kex settings too.

Hi @ahq Welcome!
Consider using the SSH node (self hosted) connected to an AI agent as a tool although this is risky giving an AI the access of some VPS, and then configure it with your juniper router credentials and then set the Execute command operation with dynamic command field so that the agent is capable of running any router command on demand.

Although this can be risky as you are giving a lot of permissions in AI agent’s hands.