2

I'm trying to rename the standard user account "kali" in my Kali linux installation. I've tried two different ways.

First I used the root account to rename the user account and change the home directory the following way:

Using the root account:

pkill -9 -u old-username usermod -l new-username old-username usermod -d /home/new-user-name -m new-username groupmod -n new-groupname old-groupname 

The result is, when I try to log into the new account it seems some of it is working, like the browser I had previously open opens again etc. But the desktop doesn't fully load, I get no task bar etc.

The other way I tried is creating a new user, adding the user to the same groups as the current user. Copying over the home directory and chowning the new users directory:

sudo su adduser new-username adduser new-username sudo adduser new-username netdev #doing that with all other groups the old user is part of cp -r /home/old-username /home/new-username chown -R new-username:new-username /home/new-username 

When I do that, some things seem to be working, but the desktop settings aren't copied and I don't have the previously installed apps or for example Firefox extensions.

0

3 Answers 3

1

I faced the same issue before. In my case, this command fixed the issue:

 grep -rl 'old_username' home_directory_of_new_user/.* | xargs sed -i.bak -e 's/old_username/new_username/g' 

As you can see, this is a crude, not promising approach.

0

Changing the user name does not transfer all your GUI settings. Maybe copy the hidden files and directories over from the previous home directory, if there is one. Kali doesn't work like a typical desktop distro. Many of the defaults are not expected by a typical user.

I don't use Kali, but I did use backtrack, which Kali came from.

0

Don't try to rename the user account. Create a new one and disable the old when you are sure the new one is working as expected.

You can safely copy across your own files and directories. You can also safely copy across the shell initialisation files such as ~/.profile. But do not attempt to copy across the GUI configuration files.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.