Reservations:
- It was written as a guide for beginners.
- The method is not suitable for "
gray " IP.
You can remotely control your desktop using TeamViewer. However, for example, to manage home PCs with Linux on board, if you only need to edit configs or work with files, and not with X-applications, it is easiest to use ssh. But what if the remote machine IP is constantly changing? In this case, the DynDNS service will help. The principle of its operation is simple: the service creates a specific domain for you, and your computer using this service assigns the current IP address to the domain.
Register an account and domain
DynDNS provides several tariff plans, however, we will consider a free version of its use. To create a domain name, it is enough to register on the service and fill out a small form on the site Dyn.com. So, go to the
registration link and fill out the form:
')
Click
Create Account to create an account. We check mail, follow the link in the email, enter your password and complete the registration by clicking on
Confirm Account :
The account has been created, now we are offered to choose a tariff from the offered ones. Paid tariffs are colorfully painted throughout the page, but we want to use the service for free; to do this, select the "
free Dynamic DNS " link at the very bottom of the page:
We proceed to the creation of a domain name. Fill out the form by choosing the name of your subdomain, the domain in which it will be located (I chose dyndns.org), and also fill in the current IP of our computer that we want to connect to the service:
Click
Add To Cart , confirm your choice by clicking
Proceed to checkout :
The domain is created, we activate its work with the
Activate Services button:
Domain ready to go:
Now we can proceed to configure the computer itself.
Service setting
In order for the service to know our current IP, it is necessary to provide it with such data. Set up a client on the computer. Go to the console and install ddclient (the command is for Ubuntu, for non-deb-based distributions, you can download
ddclient and install it manually):
sudo apt-get install ddclient
Now you need to configure the client:
sudo gedit /etc/ddclient.conf
The configuration file already contains a lot of settings, however, we will uncomment and configure only the most necessary:
daemon=300
syslog=yes
mail=root
mail-failure=root
pid=/var/run/ddclient.pid
ssl=yes
login=linux-easy
password=********
server=members.dyndns.org, \
protocol=dyndns2 \
linux-easy.dyndns.org
Obviously, instead of asterixes (asterisks), you must specify a password from your DynDNS account. Save the configuration file and restart ddclient:
sudo /etc/init.d/ddclient restart
After that, the computer will send the current IP service to DynDNS, which will apply it to our domain linux-easy.dyndns.org. Now we can connect to it via ssh or even via ftp (after setting up an ftp server).