I am a newbie in networking and I am trying to setup a SSH server, so that I can access the files on my host. I used openssh-server to successfully setup and connect to the server (on LAN).
While connecting, I use my IP address: e.g. ssh [email protected] etc.
Now the problem is, my host gets the IP address dynamically, so every time I restart my host machine, the SSH server will have a different location (IP address).
I tried using avahi-daemon and could not connect using my hostname.
I have 2 questions:
If my host is on the same network, how can I access it using the hostname (I don't want to enter the IP address while connecting)?
If my host machine is on my home network, how can I access it from my Work network?
I remember, on Windows, if my host and client are on the same network, I can simply connect using the hostname.
.
The basic idea is I could have my host machine at
(a) Work (LAN) where I cannot access the router.
(b) at home (Using the internet) .
I want to access the host machine, without using the IP address. And I want to access all the files on my host machine. Is there any easy solution to this?