talk about client setup
[ssh-dyndns.git] / README.rst
index 4a456e0fb6f902558344491a37db015957788e97..34341e62edecab14b4e30eaee598e56eaecacc62 100644 (file)
@@ -18,19 +18,20 @@ tinydns is part of the dbjdns/dbndns package.
 Setup
 =====
 
+Server
+======
 1. Clone ssh-dyndns into a sensible location, e.g. ``/usr/local/src/ssh-dyndns``::
 
     $ cd /usr/local/src/ && git clone git://git.cweiske.de/ssh-dyndns.git
 
 2. Create a user with ``ssh-dyndns`` as login shell::
 
-    $ useradd -g nogroup -m -N -s /usr/local/src/ssh-dyndns dyndns
+    $ useradd -g nogroup -m -N -s /usr/local/src/ssh-dyndns/ssh-dyndns dyndns
 
-3. Setup password-less ssh keys for the dyndns user::
+3. Prepare password-less ssh keys for the dyndns user::
 
     $ su - dyndns -s /bin/bash
     $ mkdir ~/.ssh
-    $ cat /path/to/key.pub >> ~/.ssh/authorized_keys
 
 4. Prevent showing login messages::
 
@@ -43,6 +44,34 @@ Setup
     $ cp /usr/local/src/ssh-dyndns/ssh-dyndns.sh.config-dist /etc/ssh-dyndns.sh
     $ nano /etc/ssh-dyndns.sh
 
+6. Allow ssh-dyndns to run "sudo make" without password::
+
+    $ visudo
+    dyndns  ALL= NOPASSWD: /usr/bin/make
+
+
+Client
+======
+On a machine at home, or which other IP you want to dyndns, setup a new ssh key
+as one of your users::
+
+    $ mkdir ~ssh-dyndns
+    $ cd ~/ssh-dyndns
+    $ ssh-keygen -N "" -C "dyndns@home.example.org" -f ~/ssh-dyndns/ssh-dyndns_rsa
+
+Copy the contents of the public key (``ssh-dyndns_rsa.pub``) into
+``/home/dyndns/.ssh/authorized_keys`` on your server.
+
+Run the next command manually to confirm the new ssh key::
+
+    $ cd ~/ssh-dyndns/ && ssh -i ssh-dyndns_rsa dyndns@example.org home.example.org
+
+If that worked, and you DNS entry worked, add the command to cron::
+
+    $ crontab -e
+    # update dns entry home.example.org every 5 minutes
+    */5 * * * *  cd /home/$user/ssh-dyndns/ && ssh -i ssh-dyndns_rsa dyndns@example.org home.example.org
+
 
 Configuration
 =============