Skip to content

Instantly share code, notes, and snippets.

@shortword
Last active July 28, 2023 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shortword/4faec113b62656746ca84031c8e4c90d to your computer and use it in GitHub Desktop.
Save shortword/4faec113b62656746ca84031c8e4c90d to your computer and use it in GitHub Desktop.
reMarkable2 - Send ssh keys from github to device

GitHub Public Keys to reMarkable2

This code pulls the public keys from your GitHub account, and uploads them as authorized_keys to your reMarkable2

Process

  1. Personally, I think its a bit easier to do this over USB rather than WiFi. When connected over USB it will emulate an ethernet device.
  2. Enable SSH on your reMarkable. As of this writing, you can do this be navigating: Menu -> Settings -> Help -> Copyrights and Licenses
    • On this page (General Information), you'll see your IP address(es) and root password. You'll need these shortly.
  3. Below, you'll need to set RM_IP_ADDR with one of the IP addresses here.
    • If you have multiple, the USB connection will likely be in the 10.xxx.yyy.zzz range. On my device, this is 10.11.99.1.
  4. Below, you'll need to set GH_USERNAME with your GitHub username.

The Script

These scripts are run on the device connected to your rM2. Your desktop, laptop, linux-capable toaster, whatever.

RM_IP_ADDR="YOUR_RM2_IP_ADDRESS"
GH_USERNAME="YOUR_GITHUB_USERNAME"
wget -q -O - "https://github.com/${GH_USERNAME}.keys" | ssh root@${RM_IP_ADDR} "mkdir /home/root/.ssh && chmod 700 /home/root/.ssh && tee -a /home/root/.ssh/authorized_keys"

After running this you'll be prompted for the password (noted in step 1 above). After entering that you will see your GitHub public keys printed.

Assuming you see your keys printed, you should now be able to ssh into your rM2 without a password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment