# Private Servers Deployment

### Prerequisites

* Ensure that **SSH server** is running on your device.
* If your SSH server runs on a non-default port (not 22), update the SSH port in the Blockops UI to match.
* Ensure your deployment user does **not require a password for sudo** commands.
  * You have two options:
    1. **Create a dedicated passwordless user** for Blockops.
    2. **Allow passwordless sudo** for your user by editing the sudoers file:

       ```bash
       sudo visudo
       ```

       Add this line (replace `youruser` with your actual username):

       ```bash
       youruser ALL=(ALL) NOPASSWD:ALL
       ```

### Authentication Methods

1. Password-Based SSH Authentication: you'll need:

   1. username: the username on your device
   2. password: the password for that user
   3. port: the SSH port (default: 22)

   <br>
2. Private Key Authentication

{% hint style="info" %}
Blockops does not support passphrased private keys.
{% endhint %}

1. Create a new SSH key pair: run this command on your terminal<br>

   ```
   ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
   ```
2. When prompted:
   1. File path: Press Enter to save to default (\~/.ssh/id\_rsa)
   2. Passphrase: Press Enter to create a key without a passphrase<br>
3. Add the public key\
   Copy the contents of `~/.ssh/id_rsa.pub` into `~/.ssh/authorized_keys`

### Connecting Your Private Server to Blockops

**Log in**

* Go to [app.blockops.network](https://app.blockops.network)
* Sign in or create an account

#### Select deployment options

1. Choose the network you want to deploy
2. Select Baremetal as the cloud provider
3. In the Authentication section, check the private server field and follow the on-screen instructions.

#### Install Autossh

On your private server, install autossh:

{% tabs %}
{% tab title="MacOS" %}

```bash
brew install autossh
```

{% endtab %}

{% tab title="Ubuntu/Debian" %}

```bash
sudo apt update && sudo apt install -y autossh
```

{% endtab %}
{% endtabs %}

#### Establish the SSH Tunnel

Run this command once (to add blockops.sh:7777 to known\_hosts):

{% hint style="info" %}
You can find this command in the **Authentication** section after selecting the **Private Server** option.
{% endhint %}

```bash
sudo autossh -M 0 -R example71:22:localhost:22 blockops.sh -p 7777
```

Then, re-run the same command to establish the persistent connection

```bash
sudo autossh -M 0 -R example71:22:localhost:22 blockops.sh -p 7777
```

This creates a private, secure tunnel between your server and Blockops.

#### Deploy Your Node

Return to the Blockops UI and click Continue to finalize the connection and deploy your node.
