Software⏱️ 4 min read📅 2026-06-11

How to Fix: Tomato 1.25 router administration using SSH fails with publickey error

Tomato router administration fails with publickey error

Quick Answer: Check if the public key is correctly formatted and pasted into Tomato's SSH settings, ensuring no spaces or extra characters.

The error 'Permission denied (publickey)' occurs when the SSH public key generated on your MacBook is not correctly configured or recognized by the Tomato router. This issue affects users who have generated a new public key and are trying to establish an SSH connection with their router.

This error can be frustrating, especially for developers who rely on SSH connections to test and deploy applications remotely. In this guide, we will walk you through the steps to resolve this issue and share additional tips for setting up name-based VirtualHosts on your Tomato router.

⚠️ Common Causes

  • The primary reason for this error is that the SSH public key generated on your MacBook may not be correctly formatted or recognized by the Tomato router. This can happen if the passphrase is too long or if the key is not properly copied into the router's configuration.
  • An alternative cause for this error is that the Tomato router may have a specific configuration requirement for SSH public keys, such as a specific format or encoding. In this case, the router may reject the public key generated on your MacBook.

🛠️ Step-by-Step Verified Fixes

Updating the Tomato Router Configuration

  1. Step 1: Open a web browser and navigate to the Tomato router's configuration page by typing its IP address in the address bar (e.g., http://10.10.10.1). Log in with your admin credentials.
  2. Step 2: Click on the 'Advanced' tab and then select 'SSH' from the drop-down menu. Make sure that the 'Allow SSH connections' checkbox is enabled.
  3. Step 3: Scroll down to the 'Public Key Authentication' section and click on the 'Edit' button. Paste the contents of your id_rsa.pub file into the 'Public key' field, making sure to include any trailing newlines or whitespace.
  4. Step 4: Click 'Save' to apply the changes. Restart the router by clicking on the 'Restart' button or by unplugging and replugging the power cord.

Checking Public Key Format

  1. Step 1: Check the format of your id_rsa.pub file to ensure that it matches the expected format for Tomato routers. The public key should be in the following format: ssh-rsa
  2. Step 2:Verify that the passphrase is not too long and does not contain any special characters or whitespace. If the passphrase is too long, try shortening it or removing special characters.
  3. Step 3: Try copying the public key into the router's configuration page using a different method, such as pasting from a text editor.

🎯 Final Words

Once you have updated the Tomato router configuration and checked the format of your SSH public key, you should be able to establish an SSH connection with your router. If you are still experiencing issues, try restarting the router or seeking further assistance from the Tomato community forums.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions