Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get ssh up and running on a router running Tomato.

I just generated a new public key using

$ ssh-keygen

and everything went as expected. Typed in a passphrase, told me it was saved.

I copied that resulting contents into Tomato so that it now looks like this:

enter image description here

When I try to connect I get the following error:

$ ssh
Permission denied (publickey).

First time trying to do this with Tomato. Any thoughts?

FWIW, I'm trying to make it so that I can test sites I'm developing on my MacBook using name based VirtualHosts to work on my iPad for testing following this sort of advice. Any suggestions in that department would be welcome, as well.

share|improve this question
Try connecting with ssh root@ instead. – CGA Aug 26 '11 at 12:42
@CGA: That did it. Could you answer the question so I can accept your solution, maybe with some background about why you need the root@ prefix? – Tim Visher Aug 30 '11 at 8:33
up vote 1 down vote accepted

As CGA correctly asserts, you need to specify the user that you wish to log in as. If you don't do this, you will essentially be trying to log in as the current local user on the remote machine. In other words, if you're logged in as rune on your local computer, and you try to log in via ssh on the remote machine using this command:

rune@runescomp:~$ ssh

it will be equivalent to the following command:

rune@runescomp:~$ ssh rune@

which will get rejected unless there's a user named rune on the remote machine.

share|improve this answer

I was having this same problem except that I was already using ssh root@ I tried all sorts of stuff and went over my instructions over and over. I came to find out that there is a bug in Ubuntu (the system I was using to connect) that has been present for many, many versions which causes this problem. The solution was simply to type ssh-add from the Ubuntu client and enter the same pass phrase (or lack thereof) that was entered before. BAM! Instant access!

I just thought I would add that in case folks found this thread while searching for a solution (as I did).

HTH, Billy

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .