To establish a password-less connection between the SBC and the remote server, refer to the procedure below. The following procedure generates an ssh key on the remote server that is now required to connect to the SBC. The new key is then copied onto the SBC to allow for the connection to complete without a password.

  1. Generate key on the remote server. The example commands are shown below:

    bats12:~> ssh-keygen
    generating public/private rsa key pair
    Enter the file in which to save the key (/home/<username>/.ssh/id_rsa): testingkey
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in testingkey.
    Your public key has been saved in testingkey.pub.
    The key fingerprint is:
    SHA256:uxVaJoaxAPGaWnlLd9Wwfja1R4WU13e2XUvcInwjmMI<username>@bats12
    The key's randomart image is:
    +---[RSA 2048]----+
    |  o.   .  .+ .oo+|
    |   o    E o++ *oX|
    |    o .  .o .+o=O|
    |   + . + o   . =.|
    |  = o + S = + . .|
    | o o o o * + . . |
    |.   .   o .      |
    |         o       |
    |        .        |
    +----[SHA256]-----+
  2. On the remote server, edit the ~/.ssh/config file as shown below.

    Note

    The keytest file contains the private key which corresponds to the public key provided to the SBC in the heat template at instance creation time.

    vi ~/.ssh/config
     
    Host 10.34.194.36
        Port 2024
        User linuxadmin
        IdentityFile /home/<username>/keytest

    The following is an example of the the kind of data that is in the keytest.pub file.  This key value is provided at the time of instantiating SBC nodes:

    bats16:~> vi keytest.pub
    
    AAAAB3NzaC1yc2EAAAADAQABAAABAQDzhZL4PpzG1xta1aaHHFimvO1/
    otqcUdwhhgrTMgw+f4TOmpPk5Tkt/Iq359B/PW9PRXEyjATnHqsC9b9F8KHfGD9cvNZQovujxO/
    ottFK+cj7siX3/SNvmRGl8B34rv8CKnzC+BhER6pL+1ROS3HOOPGK+
    EoRHKmXE666OL8upb4yRYDS9rmftw1DgnOI+YuDwSQCjmfickFw8cpvRXYnRtRI
    +Y71FN2fUBKvRLxMkxNN+f1quJEnYOB7rpGWBY1uPucLmuJIjfhdY2VBg/
    F9ywR1cNx4CpdTpnX/urGI4/o5w56wFvEVIqZk7sN6VSBJj1PWdT7gqaO7s8ge0J4z 
    <username>@bats16"



  3. Using ssh-copy-id, copy the key to the SBC:

    Note

     The public key being copied is the public key generated in step 1.

    bats12:~>ssh-copy-id -i testingkey.pub -f linuxadmin@10.34.194.36
    /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "testingkey.pub"
     number of key(s) added is 1.
  4. Log into the machine with ssh 'linuxadmin@10.34.194.36' and check to ensure that only the proper key(s) were added. 
  5. Next, ssh to the SBC, and check that no password prompt appears.

    Note

    No port 2024 is required at this point as ssh will pick it up from the ~/.ssh/config file.

    bats12:~> ssh linuxadmin@10.34.194.36
    Last login: Mon Dec 17 01:40:33 EST 2018 from 10.54.81.11 on ssh
    Sonus ConnexIP OS 06.02.00-R000 GNU/Linux
    linuxadmin@vsbc1:~$ exit
    exit