Setup with Pritunl – DZone

Review

This documentation provides a comprehensive guide to setting up a Virtual Private Network (VPN) server using Pritunl, a popular open source VPN server management platform. By following these steps, users can establish a secure and private network infrastructure suitable for a variety of applications, such as remote access, secure communication, and data privacy.

Prerequisites

  • AWS account: Users must have an active AWS (Amazon Web Services) account to create and manage instances on the cloud platform.
  • To create an instance: Need to create EC2 instance in desired region (eg Mumbai) using Ubuntu 22.04 AMI. Users should ensure that ports 80, 443 and 22 are allowed in the security group settings.
  • Access to instances: Users need SSH access to the instance created on AWS. They should possess the private key associated with the EC2 instance to establish a secure connection.
  • Web browser: A web browser, preferably Google Chrome, is required to access the Pritunl dashboard and configure VPN server settings.
  • Pritunl client: To connect to the VPN server from client computers, users must install the Pritunl client application. The client can be installed on a variety of operating systems, including Windows, macOS, and Linux distributions.
  • Network configuration: Users should ensure proper network configuration, including DNS settings, virtual network details, and firewall rules, to establish seamless communication between the VPN server and client computers.

Setting up a VPN server

Step 1: Setup instance

  • Launch an instance in the Mumbai region using the Ubuntu 22.04 AMI.
  • Verify that ports 80, 443, and 22 are allowed in the security group.

Steps to launch an instance

  • Select Mumbai region.
  • Start the instance, giving it a name.
  • Select the specified AMI.
    quick start
  • Select the instance type t2.micro
  • Select or create a key pair
  • Choose a default VPC and adjust the network settings if necessary
  • Allow SSH, HTTP and HTTPS connections in the security group
  • Start the instance

Step 2: Access the instance and set up a VPN

  • SSH into the instance: ssh ubuntu@yourip -i “key”
  • Switch to root: sudo -i
  • Execute the following commands
sudo tee /etc/apt/sources.list.d/pritunl.list << EOF

deb http://repo.pritunl.com/stable/apt jammy main

EOF



# Import signing key from keyserver

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A

# Alternative import from download if keyserver offline

curl https://raw.githubusercontent.com/pritunl/pgp/master/pritunl_repo_pub.asc | sudo apt-key add -



sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list << EOF

deb https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse

EOF



wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -



sudo apt update

sudo apt --assume-yes upgrade



# WireGuard server support

sudo apt -y install wireguard wireguard-tools



sudo ufw disable



sudo apt -y install pritunl mongodb-org

sudo systemctl enable mongod pritunl

sudo systemctl start mongod pritunl

Respond with Enter twice when prompted during the process

sudo sh -c 'echo "* hard nofile 64000" >> /etc/security/limits.conf'

sudo sh -c 'echo "* soft nofile 64000" >> /etc/security/limits.conf'

sudo sh -c 'echo "root hard nofile 64000" >> /etc/security/limits.conf'

sudo sh -c 'echo "root soft nofile 64000" >> /etc/security/limits.conf'

Step 3: Access the application through Chrome browser from your system

  • Go to the Chrome dashboard and enter the URL as follows
  • Continue to connect after moving forward.

it is not safe

Step 4: Generate setup key

  • Run the command: `pritunl setup-key`

  • Get the setup key from the command output.

Step 5: Set up a VPN

  • Enter the dashboard setup key and save.
  • Make sure port 27017 is allowed in the security group.

eye

Then this page will be displayed again.

Please continue to connect again.

Please continue to connect again.

Step 6: View the default password

  • To view the username and password, execute the command:

pritunl default-password

  • Copy the credentials from the output and login to the network interface.

Apply

After that you will be sent to the setup screen.

initial setup

Click the Save button after making the necessary changes to your username or password. This is the site you should check out.

Step 7: Add the organization

add an organization

to add

Step 8: Add a user

myorg

add user

Step 9: Set up the server

users and organizations

The page you should check out is this:

servers
The page you should check out is this:

  • Enter the DNS IP, virtual network, port and server name. Press Add.
  • Make sure the specified port is allowed in the security group.

Step 10: For the joining organization

The page you should check out is this:

attach the organization

This is the page you should check out:

attach the organization

Step 11: Start the server

The page you should check out is this:

Click on "Start the server" button to start the VPN server.

The page you should check out is this:

servers

Setting up the client machine

Step 12: Set up the client machine

  • Install the Pritunl client or start a new instance.
  • During installation, type ‘y’ when prompted.
sudo tee /etc/apt/sources.list.d/pritunl.list << EOF

deb https://repo.pritunl.com/stable/apt jammy main

EOF



sudo apt --assume-yes install gnupg

gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7568D9BB55FF9E5287D586017AE645C0CF8E292A

gpg --armor --export 7568D9BB55FF9E5287D586017AE645C0CF8E292A | sudo tee /etc/apt/trusted.gpg.d/pritunl.asc

sudo apt update

sudo apt install pritunl-client-electron

Step 13: Download the user profile

Download the user profile.

Step 14: Access the Pritunl client

  • Access the Pritunl client application from the Application menu.
  • View and attach a user profile.

  • Connect and enter the PIN created in step 8.
  • Ensure proper connection establishment.

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *