Skip to content

Instantly share code, notes, and snippets.

@drwasho
Last active August 28, 2016 23:39
Show Gist options
  • Save drwasho/a4482a6706fd2d6fdaf5585d7b5473a4 to your computer and use it in GitHub Desktop.
Save drwasho/a4482a6706fd2d6fdaf5585d7b5473a4 to your computer and use it in GitHub Desktop.
Basic Instructions for Spinning up a VPS & OB Node w/ reasonble security

Instructions

  1. Create a VPS on Digital Ocean
    • Ensure that it is created with SSH access setup
  2. Login as root via ssh
    • ssh root@ipaddress
  3. Create a user
    • adduser yourusername
    • Add a password
  4. Give user root access
    • visudo
    • Add yourusername ALL=(ALL:ALL) ALL under root ALL=(ALL:ALL) ALL
  5. Logout of the VPS and login as yourusername
    • ssh yourusername@ipaddress
    • You'll be prompted to type in your password this time
  6. After you login, you'll be in the $HOME directory (i.e. /home/yourusername/)
  7. Setup SSH access to yourusername
    • mkdir .ssh
    • chmod 700 .ssh
    • cd .ssh
    • nano authorized_keys
      • Paste in your RSA pubkey (example below)
    • chmod 600 authorized_keys
  8. Harden the security of the VPS
    • Open the ssh config file as root
      • sudo -s
      • nano /etc/ssh/sshd_config
    • Change SSH port to something non-standard
      • Change Port 22 to Port insertnumberhere
    • Disable root access:
      • Change PermitRootLogin yes to PermitRootLogin no
    • Disable password access (SSH only as a non-root user):
      • Change ChallengeResponseAuthentication yes to ChallengeResponseAuthentication no
      • Change PasswordAuthentication yes to PasswordAuthentication no
      • Change UsePAM yes to UsePAM no
    • Save (Ctrl-o) and exit (Ctrl-x)
    • Restart sshd
      • service sshd restart
  9. Run OpenBazaar
    • From $HOME: cd OpenBazaar-Server
    • Modify the ob.cfg to have your custom username and password
      • Remove # in front of #USERNAME and #PASSWORD, and replace username and password with whatever you want
    • Run the server in daemon mode allowing access from any IP address: sudo python openbazaard.py start -da 0.0.0.0

Install Script for Ubuntu 16.04.1

#!/bin/bash

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install git  build-essential libssl-dev libffi-dev python-dev openssl python-pip libsodium-dev autoconf libzmq-dev pkg-config libtool
sudo pip install cryptography
(cd /$HOME/; sudo git clone https://github.com/OpenBazaar/OpenBazaar-Server.git)
(cd /$HOME/OpenBazaar-Server; sudo pip install -r requirements.txt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment