Why can't access my router with ssh?(solved)

login with dropbear
ssh root@192.168.2.1
Install the openssh-server

opkg update 
opkg install openssh-server

Edit /etc/ssh/sshd_config and change

#PermitRootLogin without-password
to
PermitRootLogin yes

Enable and start OpenSSH server.

/etc/init.d/sshd enable 
/etc/init.d/sshd start

Noe disable Dropbear

/etc/init.d/dropbear disable 
/etc/init.d/dropbear stop

Exit from dropbear's login.It can't login with standard openssh way.

ssh root@192.168.2.1
ssh: connect to host 192.168.2.1 port 22: Connection refused

It can login via firefox with password,how to fix it?

You should stop Dropbear before starting OpenSSH.

1 Like

How to fix then?

/etc/init.d/dropbear stop
opkg update 
opkg install openssh-server
...

OpenSSH probably failed to start, because DropBear had port 22 already open.

2 Likes

I set dropbear on port 1000.

Can't login with ssh

ssh root@192.168.2.1 -p 1000
ssh: connect to host 192.168.2.1 port 1000: Connection refused

Both openssh and dropbear can't login ,how can i do now?

It is no use to set interface as lan.

Check whether there's a firewall rule in place limiting access to port 22.

List all rules in my openwrt!

1 Like

and did you actually restart the service/daemon, or reboot, after making the reconfiguration.

If it's LAN, there's no FW involved.

1 Like

The default FW rules do permit any incoming connections on the LAN interface but it's not uncommon that this default gets changed by the user.

1 Like

so might be, but then it's an user error, not an FW/openwrt issue :wink:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.