# Niflheim VPN console client

> Niflheim CLI utility for terminal-based VPN server management - user provisioning, WireGuard and IKEv2 config generation, and tunnel monitoring

Source: https://opennix.org/en/docs/niflheim/console-client/


The Niflheim VPN console utility has been developed to be easy to manage.

## User management

1. User List 
   
To get a list of existing users, the user needs to input the command: 

```shell
niflheim-cli users -l
```
2. Adding a new user
   
To add a new user, enter the following command: 

```shell
niflheim-cli users -a user-name
```

You can  see the execution of this command in the following example: 

```shell
niflheim-cli users -a newuser
Adding new user - newuser to niflheim vpn in progress. Please wait
deployment in progress.....: 632B [01:22, 7.61B/s] 
User newuser has been added to niflheim vpn
```

Then you can see below the list of created configuration files for new users after the command completes.

```shell
find . -name "*newuser*"
./wireguard/apple/macos/newuser.mobileconfig
./wireguard/apple/ios/newuser.mobileconfig
./wireguard/newuser.conf
./wireguard/.pki/public/newuser
./wireguard/.pki/preshared/newuser
./wireguard/.pki/private/newuser
./wireguard/newuser.png
./ipsec/apple/newuser.mobileconfig
./ipsec/manual/newuser.secrets
./ipsec/manual/newuser.conf
./ipsec/manual/newuser.p12
./ipsec/.pki/reqs/newuser.req
./ipsec/.pki/public/newuser.pub
./ipsec/.pki/certs/newuser_crt_generated
./ipsec/.pki/certs/newuser.crt
./ipsec/.pki/private/newuser_ca.p12
./ipsec/.pki/private/newuser.p12
./ipsec/.pki/private/newuser.key

```

3. Deleting a user

To delete a user, the user needs to enter the following command: 

```shell
niflheim-cli users -d user-name
```
This command deletes the user as well as all configuration files that are related to that user. 

### Updating the VPN server configuration

The server configuration is generated when the server starts for the first time. The configuration file is located at the following path: 
`/opt/niflheim/config.cfg`

You can edit the configuration file, but the settings will not be applied instantly. The following command should be used to apply a change to the configuration: 

```shell
 niflheim-cli  server -u
```

