Site Tools


router_to_router_ssh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
router_to_router_ssh [2024/10/31 22:28] – [Usage Example] hogwildrouter_to_router_ssh [2024/10/31 22:39] (current) – [Setting up/Establishing a Tunnel] hogwild
Line 12: Line 12:
   * For running scripts on the secondary router using supported commands.   * For running scripts on the secondary router using supported commands.
   * As seen below, for switching wireless radio(s) on/off on a schedule (not shown).   * As seen below, for switching wireless radio(s) on/off on a schedule (not shown).
- 
  
 ===== Setting up/Establishing a Tunnel ===== ===== Setting up/Establishing a Tunnel =====
Line 18: Line 17:
 Follow these steps to generate a Keypair and establish an SSH tunnel: Follow these steps to generate a Keypair and establish an SSH tunnel:
  
-  - On the primary router (the one issuing SSH commands) generate a Keypair \\ by typing the command:  "dropbearkey -t rsa -f ~/.ssh/id_dropbear" \\ \\ This will display a result similar to that shown below. Leave this window open. \\ You'll need it for step 2. \\ \\ {{:pasted:20210921-152323.png?744}} \\ \\  +  - On the primary router (the one issuing SSH commands) generate a Keypair \\ by typing the command:  "dropbearkey -t rsa -f ~/.ssh/id_dropbear"\\ \\ This will display a result similar to that shown below. Leave this window open. \\ You'll need it for step 2. \\ \\ {{:pasted:20210921-152323.png?744}} \\ \\ \\  
-  - Copy the Public key portion from the primary router and paste it into \\ the “Authorized Keys” field in secondary router: \\ \\ {{:pasted:20210921-152415.png?739}} \\ \\ +  - Copy the Public key portion from the primary router and paste it  \\ into the “Authorized Keys” field in secondary router: \\ \\ {{:pasted:20210921-152415.png?739}} \\ \\ \\ 
   - In the above screenshot, a pre-existing, unrelated key was redacted. \\ \\    - In the above screenshot, a pre-existing, unrelated key was redacted. \\ \\ 
-  - Now, connect to the secondary router via SSH (running on the primary router).  \\ The example below uses the //nvram// command to display the hostname. \\ The first command string ("ssh root@192.168.10.1 nvram get lan_hostname")** **\\ executes the command on the secondary router and then \\ it ["nvram get lan_hostname"] is executed locally, on the primary router. \\ \\ \\ {{:pasted:20210921-152503.png?741}}+  - Now, connect to the secondary router via SSH (running on the primary router).  \\ The example below uses the //nvram// command to display the hostname. \\ \\ \\ The first command string ("ssh root@192.168.10.1 nvram get lan_hostname")** **\\ executes the command on the secondary router and then \\ it ["nvram get lan_hostname"] is executed locally, on the primary router. \\ \\ \\ {{:pasted:20210921-152503.png?741}}
  
  \\  \\
Line 32: Line 31:
 ===== Usage Example ===== ===== Usage Example =====
  
-This example enables/disables the eth1 5Ghz WiFi interface on the secondary router. (Temperature is shown only when the interface is enabled).  \\  \\+This example enables/disables the secondary router'eth1 5Ghz WiFi interface. (Temperature is shown only when the interface is enabled).\\  \\
  
-  - This screenshot shows the Primary router's status before the command is run: \\ \\ {{:pasted:20210921-152542.png?736}} \\ +  - This screenshot shows the Primary router's status before the command is run: \\ \\ {{:pasted:20210921-152542.png?736}} \\ \\  \\  
- \\ +  - Now, we run the command ("//ssh root@192.168.10.1 radio toggle 1"//): \\ \\ {{:pasted:20210921-152607.png?744}} \\ \\  \\ 
-  \\  +
-  - Now, we run the command ("//ssh root@192.168.10.1 radio toggle 1"//): \\ \\ {{:pasted:20210921-152607.png?744}} \\ +
- \\ +
-  \\ +
   - This shows the status after the command is run: \\ \\ {{:pasted:20210921-152637.png?761}} \\  \\   - This shows the status after the command is run: \\ \\ {{:pasted:20210921-152637.png?761}} \\  \\
  
Line 47: Line 42:
  
  \\  \\
- 
  
 ===== Passwordless Router-to-Router SSH Notes ===== ===== Passwordless Router-to-Router SSH Notes =====
Line 55: Line 49:
     * Either keep a copy of the "id_dropbear" file offline \\ (on a flash drive, or CIFS Client share) for restoration, or;     * Either keep a copy of the "id_dropbear" file offline \\ (on a flash drive, or CIFS Client share) for restoration, or;
     * Be prepared to repeat (steps 1. and 2.) after a reboot, \\ removing any redundant key from the secondary router.     * Be prepared to repeat (steps 1. and 2.) after a reboot, \\ removing any redundant key from the secondary router.
-  * This guide was produced using [[https://www.chiark.greenend.org.uk/~sgtatham/putty/|PuTTY]] v0.76 and FreshTomato 2021.5. + 
-  Inspiration was provided by [[https://blog.michael.franzl.name/2017/09/03/set-passwordless-ssh-login-dropbear-client/|this]] article.  + This guide was produced using [[https://www.chiark.greenend.org.uk/~sgtatham/putty/|PuTTY]] v0.76 and FreshTomato 2021.5. 
-  * The process was first documented [[https://www.linksysinfo.org/index.php?threads/%E2%80%9Cpassword-less%E2%80%9D-router-to-router-ssh-how-to.76761/|here]].+ 
 + Inspiration was provided by [[https://blog.michael.franzl.name/2017/09/03/set-passwordless-ssh-login-dropbear-client/|this]] article. The process was first documented [[https://www.linksysinfo.org/index.php?threads/%E2%80%9Cpassword-less%E2%80%9D-router-to-router-ssh-how-to.76761/|here]].
  
  \\  \\
router_to_router_ssh.1730413723.txt.gz · Last modified: 2024/10/31 22:28 by hogwild