# Add pfaffman's keys to your ssh authorized\_keys

**URL:** <https://dashboard.literatecomputing.com/t/add-pfaffmans-keys-to-your-ssh-authorized-keys/423>\
**Category:** Howto\
**Created:** [June 12, 2023, 2:54pm UTC](https://dashboard.literatecomputing.com/t/add-pfaffmans-keys-to-your-ssh-authorized-keys/423 "2023-06-12T14:54:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pfaffman](https://cdn.dashboard.literatecomputing.com/user_avatar/dashboard.literatecomputing.com/pfaffman/32/7_2.png) [@pfaffman](https://dashboard.literatecomputing.com/u/pfaffman)\
**Post date:** [June 12, 2023, 2:54pm UTC](https://dashboard.literatecomputing.com/t/add-pfaffmans-keys-to-your-ssh-authorized-keys/423/1 "2023-06-12T14:54:51Z")

</div>

## How to give Literate Computing ssh access to your server

Paste this one line into your server console

```auto
ssh-import-id gh:pfaffman

```

and send the user you log in as (usually `root` or `ubuntu`) and your IP address or hostname.

It should respond with something like this:

```auto
2025-09-03 13:21:11,426 INFO [1] SSH keys [Authorized]

```

If you have a firewall that limits access to your server by IP address (you would know if you did), please allow access from `154.9.154.67-69`.

### The Long Version

If `ssh-import-id-gh` does not work, you don’t understand where to paste that command, or you have a more complicated setup than most people, here are more explicit instructions.

First, you will need to connect to a shell (or “command line”) on your server via `ssh` or the [Digital Ocean](https://m.do.co/c/a5bf212d9a92) console or something similar. If you have ever typed something like `cd /var/discourse;./launcher rebuild app`, you need to do whatever you do to get there. Then you’ll paste (or even type!) the command below.

### Simple case using something like Ubuntu on [Digital Ocean](https://m.do.co/c/a5bf212d9a92) with username `root` or `ubuntu`

If you are using Ubuntu, you should be able to log in via SSH, or connect via the [Digital Ocean](https://m.do.co/c/a5bf212d9a92) console and paste in this command:

```
 ssh-import-id-gh pfaffman

```

You should see a few lines of text that ends with something like “`SSH keys [Authorized]`”

That’s the best way, as it will see that `authorized_keys` is created with the correct permissions.

That should do it, but if you got something that looked like an error, you may need to keep going.

### If `ssh-import-id-gh` says “command not found”

If `ssh-import-id-gh` fails for some reason, this should work:

```auto
mkdir -p -m 700 ~/.ssh 
curl https://github.com/pfaffman.keys >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

```

### If your username is not `root` or `ubuntu` I need the username

After you have added my key, all we need to know is the hostname (or IP address) and the username. If you don’t supply a username, we’ll try `root`, and `ubuntu` (which are the default for [Digital Ocean](https://m.do.co/c/a5bf212d9a92), AWS, and a bunch of other providers).

### sudo access is also required

For most setups, the user that you use (e.g., `root` or `ubuntu`) has super user privileges, but if you add a user just for me, please see that the user can use `sudo` without a password. You can do that like this:

```auto
sudo su -c 'echo =username= ALL = NOPASSWD: ALL > /etc/sudoers.d/=username=' root

```

If the user you created was not `pfaffman`, please substitute accordingly.

This will create a user, give it sudo privs and install the key:

```auto
sudo adduser --disabled-password --gecos "" =username=
sudo su -c 'echo =username= ALL = NOPASSWD: ALL > /etc/sudoers.d/=username=' root
sudo su - =username=
ssh-import-id-gh =username=

```

### If you use Cloudflare, reverse proxy, or a load balancer

If you are using Cloudflare or something else that makes your forum’s domain name not be the same as the name/IP address to use for ssh access, I will need that IP address or hostname for the virtual machine.

If you want to limit ssh access, Literate Computing will be connecting from 154.9.154.67.

### If you use a VM on Google Cloud (GCP)

See [https://cloud.google.com/compute/docs/connect/add-ssh-keys](https://cloud.google.com/compute/docs/connect/add-ssh-keys) for their documentation.

This should create a file with my key and add it to the metadata:

```auto
### get existing keys in Meta data
gcloud compute project-info describe \
 --format="value(commonInstanceMetadata[items][ssh-keys])" >> gcloud-keys
## Add pfaffman's github key as the current user
echo "$USER:$(curl -s https://github.com/pfaffman.keys|head -1)" >> gcloud-keys
### add all keys to the metadata
gcloud compute project-info add-metadata --metadata-from-file=ssh-keys=gcloud-keys

```
