# Wireguard Access to Users

This is an administrator's guide to provide access to [Wireguard Bastion](https://docs.openg2p.org/operations/deployment/scaling/base-infrastructure/wireguard-bastion) via users' devices (called peers). Access must be provided to each unique device (like a desktop, laptop, mobile phone etc). Multiple connections to Wireguard bastion with the same conf file are not possible.

{% hint style="warning" %}
The Wireguard conf file MUST NOT be shared with any other users for security reasons.
{% endhint %}

### Steps

1. Login to the Wireguard node via SSH.

   ```
   > ssh -i <SSH key pem file> <user>@<ip>
   ```
2. Navigate to Wireguard conf folder

   ```
   > cd /etc/wireguard_general
   ```
3. You will see several pre-created peer config files. You may assign any one of the file (not assigned before) to a new peer/user.
4. Edit`assigned.txt` file to assign a new the peer (client/user). Make sure a conf file is assigned to a unique user, already assigned file is never re-assigned to another user.

   ```
   > vim assigned.txt
   ```
5. Add the peers with name as mentioned below. Example:

   ```
   > peer1 : <peer name>
   ```
6. Share the conf file with the peer/user securely. Example: `peer1/peer1.conf`
7. Create a local Git repo to maintain versions of `assigned.txt.` Use `git init` command to initiate a local repo. Check in any changes to this file.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openg2p.org/operations/deployment/scaling/base-infrastructure/wireguard-bastion/wireguard-access-to-users.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
