Line 9: |
Line 9: |
| To achieve the configuration described in this article you will need the following: | | To achieve the configuration described in this article you will need the following: |
| | | |
− | *A computer running on Linux | + | * A computer running on Linux |
− | *A RUTxxx router of any type | + | * A RUTxxx router of any type |
| | | |
| ==Configuration== | | ==Configuration== |
Line 19: |
Line 19: |
| <pre> | | <pre> |
| ssh-keygen | | ssh-keygen |
− | </pre> | + | </pre>When prompted, enter the file name, for example '''rsa_key'''. Two file will then be generated: '''rsa_key''' (private) and '''rsa_key.pub''' (public). |
| </li> | | </li> |
| ---- | | ---- |
Line 25: |
Line 25: |
| Next, we'll have to add the key to your RUTxxx router. Simply execute this command via a Terminal (replace the IP address with your router's IP): | | Next, we'll have to add the key to your RUTxxx router. Simply execute this command via a Terminal (replace the IP address with your router's IP): |
| <pre> | | <pre> |
− | | + | |
| </pre> | | </pre> |
| </li> | | </li> |
| ---- | | ---- |
− | <li>'''NOTE: You only need to do this step once.''' The key will be added to the ''/root/.ssh/authorized_keys'' file. You must then move it to ''/etc/dropbear/'', and make a symlink from dropbear. To do so, login to the router via SSH and execute these commands: | + | <li> |
| + | The key will be added to the ''/root/.ssh/authorized_keys'' file. You must then copy it to ''/etc/dropbear/''. To do so, login to the router via SSH and execute this command: |
| <pre> | | <pre> |
− | mv /root/.ssh/authorized_keys /etc/dropbear/
| + | cp /root/.ssh/authorized_keys /etc/dropbear/ |
− | ln -s /etc/dropbear/authorized_keys /root/.ssh/authorized_keys
| |
| </pre> | | </pre> |
| </li> | | </li> |
| ---- | | ---- |
| <li> | | <li> |
− | At this point, the configuration is complete. To test it, terminate your current SSH connection (you can do so by executing the ''exit'' command) and try logging in again - if everything is in order, the router should no longer require a password when connecting via SSH.
| + | Next, while still connected to the router, add ''read'', ''write'' and ''execute'' permissions for the ''/etc/dropbear'' directory and ''read'', ''write'' permissions for the ''/etc/dropbear/authorized_keys'' file: |
| + | <pre> |
| + | chmod 700 /etc/dropbear |
| + | chmod 600 /etc/dropbear/authorized_keys |
| + | </pre> |
| </li> | | </li> |
| + | ---- |
| + | <li> |
| + | At this point, the configuration is complete. To test it, terminate your current SSH connection (you can do so by executing the ''exit'' command) and try logging in again - if everything is in order, the router should no longer require a password when connecting via SSH when using the command:<pre> |
| + | |
| + | </pre></li> |
| ---- | | ---- |
| <li> | | <li> |
Line 98: |
Line 107: |
| ==See also== | | ==See also== |
| | | |
− | *[[SSH RSA key authentication (Windows)]] - the same guide but aimed at Windows users | + | * [[SSH RSA key authentication (Windows)]] - the same guide but aimed at Windows users |
− | *[[Command line interfaces]] - descriptions and instruction for all types of command line interfaces supported by RUTxxx devices | + | * [[Command line interfaces]] - descriptions and instruction for all types of command line interfaces supported by RUTxxx devices |