OpenWrt Forum Archive

Topic: Trouble SSHing to openssh server behind openwrt router

The content of this topic has been archived on 2 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm running openwrt (Kamikaze 8.09) on a linksys router and am trying to SSH into a server behind it running OpenSSH. I have it set up for port forwarding (or the equivalent) so that "ssh user@dyndnsname.com -p33" leads me to login on the server with name "user". The problem is now that the Linksys router (and dropbear) has a different RSA host key than the openSSH server. I've set it up so that both the router and the serve utilize rsa.pub key so my laptop can use only one rsa key. But anytime I want to switch from SSH'ing into the router, to SSH'ing to the server using my laptop I need to clear my known_hosts file. Is there any way to set it up so that both the router and server have the same RSA host key? Thanks.

Sorry, forgot to clarify:
ssh user@dyndnsname.com -p33   -> ssh into server
ssh root@dyndnsname.com -p22   -> ssh into router

You might try using the HostKeyAlias option in your ~/.ssh_config:

Host my-server
    Hostname dyndnsname.com
    Port 33
    HostKeyAlias my-server
 
Host my-router
    Hostname dyndnsname.com
    HostKeyAlias my-router

The discussion might have continued from here.