6

I am trying to ssh to a DLink router running DDWRT:

ssh admin@192.168.1.1
Connection closed by 192.168.1.1

I tried to alter the ssh ports on the router to 2222:

ssh admin@192.168.1.1 -p 2222  
ssh: connect to host 192.168.1.1 port 2222: Connection refused  

Which is a different result. I am somehow unable to connect. What could be the problem?

  • 2
    DD-WRT has ssh disabled by default, I'm assuming you did enable it? Can you ssh into the DD-WRT from other machine? – Darius Jan 30 '14 at 11:55
  • I did enable it, and set it to listen to port 2222. Thank you for the hint with root, I tried it, it gives me the same results. I did not try to SSH into the DD-WRT from another machine than the RPi from my homenetwork. At work I tried my laptop and my Android phone via JuiceSSH. – atripes Jan 31 '14 at 9:13
7

It was possible to connect using telnet and a custom port.

The version of DD-WRT that is used (DD-WRT v24-sp2 (03/25/13) std (SVN revision 21061)) is unable to handle ssh connections.
There is currently no stable version that supports ssh.

@MariusMatutiae How would you suggest to secure the telnet connection? Does the provided root password suffice?

Thanks to all for the help.

  • I'm suffering from the same problem here. Any updates on this? Is there a link you can share to a bug report or somewhere to track status? – Dustin Kirkland Aug 26 '14 at 15:44
  • @DustinKirkland you can check if there is new update from here: dd-wrt.com/site/support/router-database. I am suffering from the same issue, just checked for my router, there is no update yet. – Vincent Sep 13 '14 at 10:03
4

From the DD-WRT online manual:

If you want to use user/password to login using SSH use user "root" with the password you set in the webinterface

So, you cannot use admin, you must use user root. And that's besides having enabled sshd in the GUI, as already suggested by @Darius.

Edit:

To be clear: I have control of 4 DD-WRT routers. On all of them, with the command

 ssh IP_Address -p port_number

the connection is refused. The connection is established if and only if I use:

 ssh root@IP_Address -p port_number

The reason is simple: if I do not provide the user name root, the system will try to log me in the router with the same username I am currently using, which, in my case, is just my first name. And, of course, such an account does not exist on any of my routers.

This being said, a connection also requires three conditions: that sshd has been enabled through the GUI, that the password provided is the same as that of the administrative account used to access the GUI, and that the port coincides with that chosen at the time of the enabling the sshd daemon.

There is, luckily, nothing else to do. And, by the way, change the authentication method to a cryptographic key ASAP.

  • 1
    does ssh 192.1681.1 -p 2222 gives you the login prompt at all? (asking for username and password) - Sorry I had a dd-wrt router but I left it at my workplace so I can't test it. – Darius Jan 31 '14 at 9:25
  • 1
    @Darius Nope: I get the login prompt for ]ssh root@192.168.1.1]. I did not modify the ssh port. Did you? If you did not, then no point in trying the option -p 2222. – MariusMatutiae Jan 31 '14 at 9:42
  • Port 2222 is manually configured, to rule out any ISP port blocking on common ports. ssh 192.168.1.1 -p 2222 yields Connection refused also. – atripes Jan 31 '14 at 10:16
  • 2
    @atrioom I have control of 4 DD-WRT routers. On all of them, with the command ssh IP_Address -p port_number, the connection is refused. The connection is established if and only if I use: ssh root@IP_Adress -p port_number. – MariusMatutiae Jan 31 '14 at 10:20
  • @MariusMatutiae yes, I tried all variations. That was just in response to Darius, so that I exactly do what he suggests, to get the outcome. I was wondering if I'd get a username prompt then too, so I tried it. – atripes Jan 31 '14 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.