Command Line Cheatsheet

Permanently authorising a connection to the emonPi

By creating a pair of Key Files - one on the emonPi and one on the machine you use to access it, you can remove the need to type a password each time you access the emonPi via SSH.

Note: this authorises the machine and whoever is using it to access the Pi, as distinct from a person who knows the password who is using the machine.

  1. Enable SSH on the emonPi / emonBase. For the emonPi only, use front panel LCD menu & pushbutton. Alternatively, for both (and the only way for the emonBase), add an empty file named “ssh” in the root partition.

  2. You must have SSH & SCP on the computer that’s being used.

  3. Generate a SSH key pair with “ssh-keygen” Don’t set a password - this authorises the MACHINE (vs the user] to update the emonPi / emonBase.

  4. This will generate the key files, in /home/[your user name]/.ssh
    The private key file, which you must keep secure, is id_rsa
    The public key file is id_rsa.pub

  5. Copy to the Pi with ssh-copy-id [remote id]
    e.g.remote-id = ‘[email protected]’,
    The SSH password “emonpi2016” is required this time only.

The SSH password will not be required again, unless you re-flash the SD card - in which case, repeat step 5 with the new SD card. You can use the same pair of key files with many emonPi’s, if you wish.