# LXC Container Root PW zurücksetzen

To reset the root password in an LXC container, you can use the lxc-attach command to gain access to the container’s shell, where you can then change the password.

1. Identify Your Container: First, list all available containers to identify the one you need to access:

```
lxc-ls --fancy
```

2. Attach to the Container: Use the lxc-attach command followed by the container name to attach to the container’s shell:

```
lxc-attach -n container_name
```

3. Reset the Root Password: Once attached, use the passwd command to change the root password:

```
passwd
```

You’ll be prompted to enter and confirm the new password.

1. Exit the Container: Type exit to leave the container shell.