How to enable and disable SSH for an Edge Device

This article describes how to enable an edge node for SSH access.

Prerequisites

Docker must be running on your machine.

Enable SSH for an edge device

  1. Check if you have an SSH key.
    cat ~/.ssh/id_rsa.pub
    If you don't have an SSH key:
    Create a key, specify the type, and follow the prompts.
    ssh-keygen -t rsa
  2. Copy the output of the "cat" command.
  3. Run the ZCLI container.
    docker run -it -v $PWD:/root zededa/zcli:latest
  4. Log in to the ZCLI
  5. Enable SSH access by pushing the SSH key to the device.
    zcli edge-node update EDGE_NODE --config=debug.enable.ssh:"YOUR_PUBLIC_KEY"
  6. Find the IP address of your edge node and save it for later use.
    zcli edge-node show EDGE_NODE --detail
  7. Exit the ZCLI to your machine's standard command line.
    exit
  8. Connect to the device via SSH using the corresponding private key.
    ssh -i YOUR_PRIVATE_KEY_PATH root@DEVICE_IP
    Example
    ssh -i ~/.ssh/id_rsa root@192.0.2.119

Disable SSH for an edge device

  1. Log in to the ZCLI
  2. Disable SSH for your edge device by removing all the public keys from the device.
    zcli edge-node update EDGE_NODE --config=debug.enable.ssh:""
  3. Verify that your public key is gone.
    zcli edge-node show EDGE_NODE --detail
Was this article helpful?
4 out of 4 found this helpful