Unable to ssh to router running DDWRT

17,358

Solution 1

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.

Solution 2

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.

Share:
17,358

Related videos on Youtube

atripes
Author by

atripes

Updated on September 18, 2022

Comments

  • atripes
    atripes over 1 year

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

    ssh [email protected]
    Connection closed by 192.168.1.1
    

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

    ssh [email protected] -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?

    • Darius
      Darius over 10 years
      DD-WRT has ssh disabled by default, I'm assuming you did enable it? Can you ssh into the DD-WRT from other machine?
    • atripes
      atripes over 10 years
      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.
  • Darius
    Darius over 10 years
    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.
  • MariusMatutiae
    MariusMatutiae over 10 years
    @Darius Nope: I get the login prompt for ]ssh [email protected]]. I did not modify the ssh port. Did you? If you did not, then no point in trying the option -p 2222.
  • atripes
    atripes over 10 years
    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.
  • MariusMatutiae
    MariusMatutiae over 10 years
    @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.
  • atripes
    atripes over 10 years
    @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
    atripes over 10 years
    Thank you, I will change the auth-method as soon as I get home. Or manage to view the Web-GUI with a graphical browser (or one that knows javascript). The three conditions seem easy to achieve, I will keep trying. There is so much to solve, I won't be bored this weekend ;))
  • ExoPlanet100
    ExoPlanet100 over 9 years
    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?
  • Vincent
    Vincent over 9 years
    @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.
  • Brian White
    Brian White almost 9 years
    Logging in as user "root" applies to telnet as well.