Skip to content

SSH Client On motionEyeOS

Calin Crisan edited this page Jun 2, 2018 · 1 revision

You may want to run remote commands from within motionEyeOS using the ssh command, on another machine. Note that this is not about logging in remotely into motionEyeOS.

  1. Generate a key pair for your motion motionEyeOS. On motionEyeOS, run the following command (hit whenever asked something):

     ssh-keygen -f /data/etc/ssh_id_rsa
    
  2. Configure the SSH client so that it reads the identity from the newly created private key:

     echo "IdentityFile /data/etc/ssh_id_rsa" >> /data/etc/ssh_config
    
  3. Tell your SSH client to store known hosts data on the writable partition:

     echo "UserKnownHostsFile /data/etc/ssh_known_hosts" >> /data/etc/ssh_config
    
  4. Optionally, but recommended: copy your motionEyeOS's public key and add it to your other machine's ~user/.ssh/authorized_keys file:

     cat /data/etc/ssh_id_rsa.pub
    
  5. Test the setup; it should run the ls -l command remotely without asking for a password (will ask you to confirm the authenticity of the remote host once, though):

     ssh user@otherhost ls -l
    
  6. If everything worked as expected, you can use the command above (tweaked to your needs) in the "Run A Command" options of motionEye.