If you've already set up a user with all configurations and GNOME extensions in Kali Linux and want to create a new user with the same setup, follow this step-by-step guide.
Step 1: Create a New User
To create a new user (newuser), run:
sudo adduser newuser
Set the password and fill in details when prompted.
Add the new user to necessary groups (check the groups of your existing user with groups olduser):
sudo usermod -aG sudo newuser
Step 2: Copy Configuration Files
To replicate the same environment, copy the configuration files from olduser to newuser:
sudo cp -r /home/olduser/.* /home/newuser/
sudo cp -r /home/olduser/.config /home/newuser/
sudo cp -r /home/olduser/.local /home/newuser/
Change ownership to the new user:
sudo chown -R newuser:newuser /home/newuser
Step 3: Copy GNOME Extensions and Settings
GNOME extensions and settings are stored in:
- ~/.local/share/gnome-shell/extensions/
- ~/.config/dconf/ (stores GNOME settings)
Copy them:
sudo cp -r /home/olduser/.local/share/gnome-shell/extensions /home/newuser/.local/share/gnome-shell/
sudo cp -r /home/olduser/.config/dconf /home/newuser/.config/
Change ownership:
sudo chown -R newuser:newuser /home/newuser/.local/share/gnome-shell/extensions
sudo chown -R newuser:newuser /home/newuser/.config/dconf
Alternatively, export GNOME settings from olduser:
sudo -u olduser dbus-launch gsettings list-recursively > gnome-settings-backup.txt
Import them for newuser:
sudo chown newuser:newuser gnome-settings-backup.txt
sudo -u newuser dbus-launch --exit-with-session bash -c 'while read -r schema key value; do gsettings set "$schema" "$key" "$value"; done < gnome-settings-backup.txt'
Step 4: Set Default Shell
If olduser used zsh, set it for newuser:
sudo chsh -s $(which zsh) newuser
Step 5: Test the New User
Switch to the new user and test:
su - newuser
Or log out and log in as newuser to verify.
Step 6: Restart GNOME Shell
If settings don’t apply immediately, restart GNOME Shell:
gnome-shell --replace &
Or reboot:
reboot
With these steps, your new user will have the same configurations and GNOME extensions as the old user. 🚀