Skip to main content

Change Default User Account

Running this on a fresh Kali installation. 
Login as kali user and run these commands to add a new default user:

# Specify the username for your new user account
username=<your_new_username_here>
# Specify that the user login shell will be zsh
user_shell=$(which zsh)
# Add any group where the kali user is a member
groups=$(grep -E '\:kali$' /etc/group | cut -d ':' -f 1 | sed -z 's/\n/,/g;s/,$/\n/')
# Create the new user account
sudo useradd -m -G $groups -s $user_shell $username
# Change the new user's password
sudo passwd $username

Log into your new account and disable the kali account:

sudo usermod -L -e 1 -s /sbin/nologin kali

Lock the account, expire it, and set the shell to /sbin/nologin

In case you need to revert this change for any reason:

sudo usermod -U -e "" -s $(which zsh) kali

Unlock the account, remove the expiration, and set the login shell to zsh