> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gcore.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enable root user on a Linux VM

After connecting to the Virtual Machine via [Gcore Customer Portal](/cloud/virtual-instances/connect/connect-to-your-instance-via-control-panel) or [SSH](/cloud/virtual-instances/connect/connect-via-ssh), enter the commands below in the terminal to run tasks with root user privileges.

## Temporary root access

The following commands provide root access without enabling the root account permanently:

* `sudo` — execute a single command as root.
* `sudo su` — switch to a root shell for the current session.
* `sudo -i` — start a login shell as root.
* `sudo -s` — start a shell as root without a login environment.

<Warning>
  Operating with root permissions allows for system-wide changes. Use these commands with caution — misuse can cause unintentional alterations or compromise system integrity.
</Warning>

## Enable root user permanently

By default, cloud-init disables the root user on most Linux VMs. Modify the cloud-init configuration file to re-enable it.

1. Run the following command to open the `cloud-init` configuration:

```sh theme={null}
sudo nano /etc/cloud/cloud.cfg
```

2. Change the line `'disable_root: true'` to `'disable_root: false'`.

3. Save the changes and close the file.

4. Update the `cloud-init` configuration by running the following command:

```sh theme={null}
sudo cloud-init clean -r
```
