--- title: "Create a Local Sudo/Root User" slug: "create-a-local-sudoroot-user" updated: 2026-06-26T07:37:47Z published: 2026-06-26T07:37:47Z canonical: "help.scalefusion.com/create-a-local-sudoroot-user" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.scalefusion.com/llms.txt > Use this file to discover all available pages before exploring further. # Create a Local Sudo/Root User The following script helps IT Admins to create a local user with sudo/root privileges. 1. Copy and save the contents below to a **UTF-8** editor like **notepad++** OR **Sublime Text** in Windows or **gedit** in Ubuntu. 1. If you are using **notepad++** then use the bottom right panel to change the type to **Unix (LF)**. ![](https://cdn.document360.io/175c0eac-012f-4410-bdc5-ac60794f82d8/Images/Documentation/image-9FFB8ZNQ.png) 2. Or click [here](https://cdn.document360.io/175c0eac-012f-4410-bdc5-ac60794f82d8/Images/Documentation/Create%20Admin.sh) to download the file. ```bash #!/bin/bash # Check if the script is run as root if [ "$(id -u)" -ne 0 ]; then    echo "This script must be run as root"    exit 1 fi # Set username and password username="XXXX" password="XXXX" # Create user useradd -m "$username" # Set password echo "$username:$password" | chpasswd # Add user to sudo group usermod -aG sudo "$username" echo "Sudo user $username has been created successfully." ``` 3. Before uploading the script to the dashboard, replace the placeholder values with the credentials you want to use: Ensure that both placeholders are updated before deploying the script. - **username (xxxx):** Enter the desired username. - **password (xxxx):** Enter the desired password. 4. Follow [our guide](/docs/deploy-linux-shell-scripts-using-scalefusion#step-1-upload-and-deploy-the-script) to upload & publish the script using Scalefusion Dashboard. > [!CAUTION] > Note: > > 1. Some of the scripts and their contents are sourced from internet and yes, our new friend ChatGPT. > 2. Please validate the scripts on a test machine before deploying them on all your managed devices. > 3. Scalefusion has tested these scripts, however Scalefusion will not be responsible for any loss of data or system malfunction that may arise due to the usage of these scripts.