Previous Topic

Next Topic

Registering Name Server Managed via SSH

To register the name server managed by SSH:

  1. Type the name server hostname into the Hostname field.
  2. Type the name server IP address into the IP address field.
  3. In you want to connect to the name server by its IP address, check the Use IP address instead of hostname for SSH connection box. In this case the also-notify directive will be automatically added to the BIND configuration file.
  4. If you would like to use the name server hostname for SSH connection, you can define upon addition of the also-notify directive to the BIND configuration file. Please, check the Force use 'also-notify' directive in the BIND config box to automatically add the also-notify directive to the BIND configuration file on the new name server.
  5. Select the SSH installation mode by setting the option button to one of the following:
  6. Enter the path to the named configuration file on the name server into the Path to named config file field (for example, /etc/named.conf). Please, make sure that the path does not include the chroot directory.
  7. Define the name server owner, i.e., the account that will have the right to use this name server. To assign the name server to a reseller account, set the option button to Reseller, click the Select button and select an owning reseller account from the list that appears in the popup menu. To assign the name server to your provider account, set the option button to your account name.
  8. In case the name server has been assigned to your provider account, you can define the name server availability policy. To use the name server from Provider Control Center for your own DNS only and make it unavailable for any of your resellers, set the option button to Hosting provider only. To allow using the name server by your resellers, set the option button to Hosting Service Provider and their resellers.
  9. Click the Save button.

To pre-configure the name server for SSH connection using distributed SSH keys, i.e., using the Use already set SSH keys for user namedsync option:

  1. Configure your bind DNS server. Please, refer to the man pages (in the command line, type man bind 2).
  2. Create user 'namedsync' and add him in 'named' group.For example, on behalf of the user root, execute the following command on the name server:

    adduser namedsync -G named

  3. Create the .ssh/authorized_keys file in the namedsync user home directory with the following permissions: owner='namedsync', group='named', mode=0600. For example, on behalf of the namedsync user, execute on the name server the following command:

    mkdir -p ~/.ssh/

    chmod 0700 ~/.ssh/

    touch ~/.ssh/authorized_keys

    chmod 0600 ~/.ssh/authorized_keys

    chown namedsync:named ~/.ssh/authorized_keys

  4. Put the SSH private key from your Management Node ( the content of /var/www/.ssh/id_dsa.pub, /var/www/.ssh/id_rsa.pub , and /var/www/.ssh/identity.pub files) into the .ssh/authorized_keys file created. For example, on behalf of the user namedsync, execute the following command on the name server and enter the Management Node root password. Note that in the actual command, 'your-mn-node' must be replaced with your Management Node hostname or IP address).

    ssh root@your-mn-node "su -l apache -c \"if [ -r .ssh/id_dsa.pub ]; then cat .ssh/id_dsa.pub;fi; if [ -r .ssh/id_rsa.pub ]; then cat .ssh/id_rsa.pub; fi; if [ -r .ssh/identity.pub ]; then cat .ssh/identity.pub; fi\"" > /tmp/ssh_pub_key && cat /tmp/ssh_pub_key > ~/.ssh/authorized_keys; rm -f /tmp/ssh_pub_key

  5. Make sure that the user apache can connect from your Management Node to the name server as user namedsync using the SSH key. For example, on behalf of the namedsync user execute the following command on the name server and enter the Management Node root password.Note that in the actual command, 'your-mn-node' must be replaced with your Management Node hostname or IP address) and 'current-ns.com' must be replaced with the name server hostname or IP address:

    if ssh root@your-mn-node "su -l apache -c \"ssh namedsync@current-ns.com ls -l /home/namedsync/.ssh/\"" > /dev/null 2>&1; then echo PASSED; else echo ERROR;fi

  6. Make sure what user namedsync can read and write in the /var/named/ directory. For example, correct permissions:

    drwxrwx--- 3 namedsync named 4096 Sep 5 17:17 /var/named

    if chroot used, check permissions on named chroot directory as well, for example, on behalf of the user namedsync execute the following command on the name server:

    if echo "TEST" > /var/named/test-file.txt; then echo PASSED; rm -f /var/named/test-file.txt; else echo ERROR;fi

  7. Make sure what user namedsync can read /etc/ssh/sshd_config. For example, correct permissions:

    -rw-r--r-- 1 root root 2469 Sep 6 20:17 /etc/ssh/sshd_config

    Execute on the name server the following command on behalf of user namedsync:

    if [ -r /etc/ssh/sshd_config ]; then echo "PASSED"; else echo "ERROR";fi

  8. Make sure what user namedsync can read /etc/named.conf or /ROOTDIR/etc/named.conf (if named uses chroot):

    -rw-r--r-- 1 root root 796 Oct 22 2003 /etc/named.conf example

    Execute on the name server on behalf of user namedsync:

    if [ -r `grep -P "^ROOTDIR=" /etc/sysconfig/named | awk -F\= '{print $2}' | sed -e "s/['\"]//g"`/etc/named.conf ]; then echo "PASSED"; else echo "ERROR";fi

Please send us your feedback on this help page