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 revisionBoth sides next revision
router_to_router_ssh [2021/09/22 01:36] – [Example] hogwildrouter_to_router_ssh [2021/09/22 01:38] hogwild
Line 4: Line 4:
  
 FreshTomato includes [[https://matt.ucc.asn.au/dropbear/dropbear.html|Dropbear]], an SSH client/server program. Dropbear can generate a KeyPair that offers password-less connections. A command is run on the primary router which generates a public key.  That Public Key must then be pasted into the secondary router’s //Authorized Keys //field, in the SSH Daemon section of the Administration/[[:admin_access|Admin Access]] menu.\\ This allows command-line management of the secondary router (or "SSH Host") from a primary router, (the "SSH Client"). This can be useful when the system clock is not maintained in the secondary router and time-sensitive jobs must be scheduled. For example, as seen below, it may be useful to switch wireless radio(s) on or off to a schedule (not shown). It could also be used to run scripts on the target for any supported command. FreshTomato includes [[https://matt.ucc.asn.au/dropbear/dropbear.html|Dropbear]], an SSH client/server program. Dropbear can generate a KeyPair that offers password-less connections. A command is run on the primary router which generates a public key.  That Public Key must then be pasted into the secondary router’s //Authorized Keys //field, in the SSH Daemon section of the Administration/[[:admin_access|Admin Access]] menu.\\ This allows command-line management of the secondary router (or "SSH Host") from a primary router, (the "SSH Client"). This can be useful when the system clock is not maintained in the secondary router and time-sensitive jobs must be scheduled. For example, as seen below, it may be useful to switch wireless radio(s) on or off to a schedule (not shown). It could also be used to run scripts on the target for any supported command.
- 
  
 ===== HOWTO ===== ===== HOWTO =====
Line 18: Line 17:
 \\ {{:pasted:20210921-152415.png}} \\ {{:pasted:20210921-152415.png}}
  
-Note that a pre-existing, and unrelated key is redacted above.  \\ +Note that a pre-existing, and unrelated key is redacted above.  \\  \\  \\ 
-\\ +
-\\+
   - Now, connect to the secondary router from within an SSH session (running on the primary router). The example below uses the **nvram** command to display the host name. 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.   - Now, connect to the secondary router from within an SSH session (running on the primary router). The example below uses the **nvram** command to display the host name. 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}} \\ {{:pasted:20210921-152503.png}}
- 
  
 ==== Example ==== ==== Example ====
  
-This example will enable/disable the eth1 5Ghz Wi-Fi interface on the secondary router. (Note that temperature is shown only when the radio is On).+This example will enable/disable the eth1 5Ghz Wi-Fi interface on the secondary router. (Temperature is shown only when the interface is on). 
 \\ \\
 \\ \\
   - This shows the status display before ([Primary router) the command is run.\\ {{:pasted:20210921-152542.png}}   - This shows the status display before ([Primary router) the command is run.\\ {{:pasted:20210921-152542.png}}
 +
 \\ \\
 +
   - Command [**ssh root@192.168.10.1 radio toggle 1**] executed.\\ {{:pasted:20210921-152607.png}}   - Command [**ssh root@192.168.10.1 radio toggle 1**] executed.\\ {{:pasted:20210921-152607.png}}
-\\  
- - Here is the status displayed after the command is run. 
  
-\\ {{:pasted:20210921-152637.png}} +\\   - Here is the status displayed after the command is run. 
-\\ + 
-\\ +\\ {{:pasted:20210921-152637.png}} \\  \\  (If the same command is repeated, eth1 will be disabled on the primary router.)
-(If the same command is repeated, eth1 will be disabled on the primary router.)+
  
 \\ **Notes** \\ **Notes**
router_to_router_ssh.txt · Last modified: 2023/05/24 02:08 by hogwild