Jump to content

Can't login to Kali Linux after changing username.

So I changed the username on my Kali Linux VM and now it doesn't let me login. When i login it just takes me to the desktop but I can't do anything or click on anything in the toolbar. This happened after changing the default Kali username to my own one. I can login as root fine but not as my other user. Thanks in advance.

Capture.PNG

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Freshby69 said:

So I changed the username on my Kali Linux VM and now it doesn't let me login. When i login it just takes me to the desktop but I can't do anything or click on anything in the toolbar. This happened after changing the default Kali username to my own one. I can login as root fine but not as my other user. Thanks in advance.

Have you tried setting the new username's password via root?

Main: AMD Ryzen 7 5800X3D, Nvidia GTX 1080 Ti, 16 GB 4400 MHz DDR4 Fedora 38 x86_64

Secondary: AMD Ryzen 5 5600G, 16 GB 2667 MHz DDR4, Fedora 38 x86_64

Server: AMD Athlon PRO 3125GE, 32 GB 2667 MHz DDR4 ECC, TrueNAS Core 13.0-U5.1

Home Laptop: Intel Core i5-L16G7, 8 GB 4267 MHz LPDDR4x, Windows 11 Home 22H2 x86_64

Work Laptop: Intel Core i7-10510U, NVIDIA Quadro P520, 8 GB 2667 MHz DDR4, Windows 10 Pro 22H2 x86_64

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, svmlegacy said:

Have you tried setting the new username's password via root?

Yes I changed it and it still doesn't work. I'm pretty sure it's letting me login, but just not letting me do anything after I login.

Link to comment
Share on other sites

Link to post
Share on other sites

I'm guessing you changed your username but not the name of the home folder... which means it doesn't know where to look for your settings. Login as root as rename your old folder, it *should* be enough in this case. Just to be sure reassign the home directory like so:

usermod --home /home/freshby69 freshby69

 

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Freshby69 said:

Yes I changed it and it still doesn't work. I'm pretty sure it's letting me login, but just not letting me do anything after I login.

Check to see if the old username's home directory still exists, and if so, try to move it to the new username?

Main: AMD Ryzen 7 5800X3D, Nvidia GTX 1080 Ti, 16 GB 4400 MHz DDR4 Fedora 38 x86_64

Secondary: AMD Ryzen 5 5600G, 16 GB 2667 MHz DDR4, Fedora 38 x86_64

Server: AMD Athlon PRO 3125GE, 32 GB 2667 MHz DDR4 ECC, TrueNAS Core 13.0-U5.1

Home Laptop: Intel Core i5-L16G7, 8 GB 4267 MHz LPDDR4x, Windows 11 Home 22H2 x86_64

Work Laptop: Intel Core i7-10510U, NVIDIA Quadro P520, 8 GB 2667 MHz DDR4, Windows 10 Pro 22H2 x86_64

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Sauron said:

I'm guessing you changed your username but not the name of the home folder... which means it doesn't know where to look for your settings. Login as root as rename your old folder, it *should* be enough in this case. Just to be sure reassign the home directory like so:


usermod --home /home/freshby69 freshby69

 

 

Just now, svmlegacy said:

Check to see if the old username's home directory still exists, and if so, try to move it to the new username?

Yes I changed the home directory as well when I changed the username. The home directory is the same as the username.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Freshby69 said:

 

Yes I changed the home directory as well when I changed the username. The home directory is the same as the username.

Check the permissions on the home folder

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

can you login with root user?

 

if it was useful give it a like :) btw if your into linux pay a visit here

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Sauron said:

Check the permissions on the home folder

When looking as the root user it has drwxr-xr-x permissions. Should it have write as well for all users?

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, mahyar said:

can you login with root user?

 

Yes I can

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Freshby69 said:

When looking as the root user it has drwxr-xr-x permissions. Should it have write as well for all users?

No, but it should be owned by the correct user.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

if there is any important file an that user back it up delete the user and create new one  

if it was useful give it a like :) btw if your into linux pay a visit here

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Sauron said:

No, but it should be owned by the correct user.

Would this be the correct command ?

sudo chown -R freshby69 ~/freshby69

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Freshby69 said:

Would this be the correct command ?


sudo chown -R freshby69 ~/freshby69

 

Yes. Personally I would also add the group (freshby69:freshby69) but that's not strictly necessary.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Sauron said:

Yes. Personally I would also add the group (freshby69:freshby69) but that's not strictly necessary.

Sorry that still didn't work, it has the same result as before.

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Freshby69 said:

Sorry that still didn't work, it has the same result as before.

Try logging in via the tty (press ctrl+alt+f2)

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Sauron said:

Try logging in via the tty (press ctrl+alt+f2)

This works fine, is there a way to access the GUI after doing this?

Link to comment
Share on other sites

Link to post
Share on other sites

16 minutes ago, Freshby69 said:

Would this be the correct command ?


sudo chown -R freshby69 ~/freshby69

 

Shouldn't this be

sudo chown -R freshby69 /home/freshby69

?

Main: AMD Ryzen 7 5800X3D, Nvidia GTX 1080 Ti, 16 GB 4400 MHz DDR4 Fedora 38 x86_64

Secondary: AMD Ryzen 5 5600G, 16 GB 2667 MHz DDR4, Fedora 38 x86_64

Server: AMD Athlon PRO 3125GE, 32 GB 2667 MHz DDR4 ECC, TrueNAS Core 13.0-U5.1

Home Laptop: Intel Core i5-L16G7, 8 GB 4267 MHz LPDDR4x, Windows 11 Home 22H2 x86_64

Work Laptop: Intel Core i7-10510U, NVIDIA Quadro P520, 8 GB 2667 MHz DDR4, Windows 10 Pro 22H2 x86_64

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, svmlegacy said:

Shouldn't this be


sudo chown -R freshby69 /home/freshby69

?

Yes I realised this after trying the first one and have changed the command. Unfortunately it still doesn't work.

Link to comment
Share on other sites

Link to post
Share on other sites

10 minutes ago, Freshby69 said:

This works fine, is there a way to access the GUI after doing this?

You can try

startx

 

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Sauron said:

You can try


startx

 

Great! It works now, do I have to do this everytime know or is there a config file I can change to fix this.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Freshby69 said:

Great! It works now, do I have to do this everytime know or is there a config file I can change to fix this.

If it works now that means there's a problem with the display manager (aka the login screen itself). Everything can be fixed with enough troubleshooting but... it's probably not worth the effort...

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Sauron said:

If it works now that means there's a problem with the display manager (aka the login screen itself). Everything can be fixed with enough troubleshooting but... it's probably not worth the effort...

Do you think I should just remove the user then and create a new one?

Link to comment
Share on other sites

Link to post
Share on other sites

11 hours ago, Freshby69 said:

Do you think I should just remove the user then and create a new one?

If you can do that it's definitely the faster solution

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

  • 1 year later...

I had this problem and found success with modifying the file below, using tty, replacing all instances of the old user name with the new user name and then rebooting.

 

/home/${newUserName}/.cache/sessions/xfce4-session-${computerName}:0

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×