0

I am having trouble getting ssh to work with a dynamic IP address. I have two laptops, one host and one guest. I have ssh set up on the host and I can ssh in from the guest as long as I know the current IP address I set up inadyn to a freedns account and that seems to be running on my host without problems.

ps -A |grep inadyn  
4179 ?        00:00:00 inadyn  
Jul 27 00:24:00 xxxxxxx INADYN[4179]: I:INADYN: Alias 'notactuallymyaccount.mooo.com' to > IP '107.xxx.xx.xx' updated successful.   

ping suggests the address is working also. However when I try to ssh from the other computer ssh [email protected] I get ssh: connect to host notacctuallymyaccount.mooo.com port 22: Connection refused Any suggestons as to why this isn't working?

1 Answer 1

1

It seems like you did not forward port 22 in your router's settings on the host side.

Also, try deleting your SSH cache on the guest like so:

rm ~/.ssh/known_hosts

7
  • I tried port forwarding but it looks like for that to work, I have to specify what ip address port 22 forwards to. Does this mean that 1) I need to have administrative privileges to use every router my host connects to and 2) I need to assign my computer a static IP address? If so, it seems there isn't really a compelling reason to set things up with inadns. I was hoping I could access my host laptop when it is say, part of the university network or when it connects to other non home networks.
    – ohnoplus
    Jul 27, 2014 at 17:05
  • You need to assign a static IP address to your laptop to make the port forwarding work. Just to clarify your case: your host and guest laptop are in 2 different local area networks? So they do not share one router?
    – jnuk
    Jul 27, 2014 at 17:15
  • Just read your comment again, both 1) and 2) are true. Where do you plan to set up your host laptop? It would be ideal to leave it f.e. at your home so you can forward the port.
    – jnuk
    Jul 27, 2014 at 17:26
  • I was hoping that I could move my host computer around. So sometimes at home, sometimes at my office. I suppose I could set up the static IP at home. I suspect I am probably out of luck at work.
    – ohnoplus
    Jul 28, 2014 at 15:48
  • 1
    You could use a VPN to make your host laptop always available at your home local area network. That way, you could forward the port and voilà, you could access it from everywhere.
    – jnuk
    Jul 28, 2014 at 16:13

You must log in to answer this question.

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