Skip to content

Instantly share code, notes, and snippets.

@towry
Last active June 22, 2019 22:06
Show Gist options
  • Save towry/9c542b39d35e109833b41afcc1ba19eb to your computer and use it in GitHub Desktop.
Save towry/9c542b39d35e109833b41afcc1ba19eb to your computer and use it in GitHub Desktop.
Installing a vps and setup vpn

Initialize the server.

  1. login as root user.
    • ssh root@server_ip_address
  2. create a new user:
    • adduser username
    • Use the usermod command to add the user to the sudo group. usermod -aG sudo username
    • Test sudo access on new user account. su - username
  3. login as new created user.
  4. sudo apt-get install build-essential
  5. For build other stuff. sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils

Install shadowsocks.

shadowsocks-libev

  • The config server address must be 0.0.0.0 or the ip address.

Install ikev2

https://github.com/quericy/one-key-ikev2-vpn

  • Determine the adapter: route

Determine

  • sudo virt-what
@towry
Copy link
Author

towry commented Jun 22, 2019

Disable Password Authentication

# on local machine.
scp ~/.ssh/id_rsa.pub <remoteUserName>@<remoteIp>:/home/<remoteUserName>/.ssh/

# on remote server
cd ~/.ssh
cat id_rsa.pub >> authorized_keys
sudo vi /etc/ssh/sshd_config

Edit sshd_config file:

PasswordAuthentication no

Then:

sudo systemctl reload sshd

@towry
Copy link
Author

towry commented Jun 22, 2019

Vultr docker setup

# login as su
su -
# Add user to docker group
usermod -aG docker username

# demo
docker run hello-world

@towry
Copy link
Author

towry commented Jun 22, 2019

Dependencies

sudo apt install xclip xsel` For pbcopy.

# edit 
vi ~/.bashrc
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'

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