This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| 2fa [2024/10/28 14:45] – -Formatting hogwild | 2fa [2025/08/13 04:51] (current) – -Change to: "The default file location is /opt/etc/environment" hogwild | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Setting up 2FA for SSH using Google Authenticator ====== | ====== Setting up 2FA for SSH using Google Authenticator ====== | ||
| - | This content was taken from the following | + | This content was taken from a Tomato |
| - | | + | These are simple configuration notes, and not intended to be a complete HOWTO. |
| - | This setup uses openssh | + | Install |
| \\ | \\ | ||
| - | Prerequisites: | + | opkg install openssh-server-pam google-authenticator-libpam |
| - | + | ||
| - | \\ Next, install openssh-server | + | |
| \\ | \\ | ||
| - | opkg install | + | If this completes without all dependencies, |
| - | Hopefully, this will include all dependencies. | + | |
| - | \\ | + | Next, enable openssh-server . This is not covered here. |
| + | |||
| + | \\ \\ Configure the correct settings in configuration file / | ||
| \\ | \\ | ||
| - | |||
| - | Next, enable openssh-server . This is not covered here.\\ | ||
| - | |||
| - | Configure the correct settings in configuration file / | ||
| #!/bin/sh | #!/bin/sh | ||
| Line 54: | Line 50: | ||
| \\ | \\ | ||
| - | The new service must be enabled at boot time as well: | + | The new service must be enabled at boot time as well. Make the following changes to the file: "/ |
| \\ | \\ | ||
| - | |||
| - | Next, run / | ||
| Port 2222 # to be changed if desired | Port 2222 # to be changed if desired | ||
| Line 138: | Line 132: | ||
| \\ | \\ | ||
| - | \\ | + | \\ Next, test the configuration from the LAN side by typing the following at the command prompt: |
| - | + | ||
| - | Next, test the configuration from the LAN side by typing the following at the command prompt: | + | |
| \\ | \\ | ||
| Line 149: | Line 141: | ||
| You should see the following: | You should see the following: | ||
| + | |||
| + | \\ | ||
| The authenticity of host ' | The authenticity of host ' | ||
| Line 164: | Line 158: | ||
| | Verification code: | | Verification code: | ||
| - | \\ | + | \\ If you see this, it means that 2FA is the only authentication operating. You can now expose port 2222 (or your configured port) to the Internet. |
| - | + | ||
| - | If you see this, it means that 2FA is the only authentication operating. | + | |
| \\ | \\ | ||
| - | You can now expose port 2222 (or the port you configured) to the Internet (not covered here). | + | The default file location is: "/ |
| \\ | \\ | ||
| \\ | \\ | ||
| - | |||
| - | PS - / | ||