I have the following host definition in my ~/.ssh/config
file:
Host testbox
User abc
Port 12345
HostKeyAlias=hello
HostName 123.123.123.123
The problem is, this host changes IP all the time. The IP is refreshed and stored in this text file ~/ip.txt
as it's contents.
Is there a way to configure SSH such that when I run
ssh testbox
I automatically connect to the newest IP read from ~/ip.txt
?
(I would prefer not to use dynamic DNS if possible.)
~/ip.txt
you could edit ~/.ssh/config instead. – Arkadiusz Drabczyk Dec 18 '20 at 18:52