Score:0

Made my user disappear

br flag

Recent I installed zsh and made it my default shell, but then I wanted the old one back and decided to uninstall using command sudo apt-get --purge remove zsh.

When I restarted my computer my user had dissapeared and I had to create a new one. Is there any way to restore my old user? I have a lot of important stuff there.

Someone avatar
my flag
Purging ZSH should not delete the user. You have backups, right? If the data was important for you then you must have kept backups of it. Restore the data from backups
hr flag
... it could however have prevented you from *logging in as* that user - since they'd no longer have a valid login shell
Matheus Coelho avatar
br flag
@Someone I checked and I still have the user, but on the login screen it doesn't show
Matheus Coelho avatar
br flag
@steeldriver is there any way to restore that shell?
Someone avatar
my flag
`sudo apt install zsh`
hr flag
... or you could change the user's old shell from the new user account: `sudo chsh -s /bin/bash oldusername`
Matheus Coelho avatar
br flag
@steeldriver I did those commands but after I restarted the computer the only user listed was the new one. I had to click in "not listed" an manually type my old username.
Matheus Coelho avatar
br flag
@steeldriver When I type `echo $0` on terminal it returns `bash` and when I type `echo $SHELL` it returns `/bin/bash` , but still can't see the user on login.
hr flag
OK sounds like that's not the problem then. Can you see the old user with `getent passwd oldusername`? Is their home directory still there (`ls /home`)? Are you able to login to a non-GUI session on one of the ttys?
Matheus Coelho avatar
br flag
@steeldriver Yeah, I can see. It returns `/home/matheus:/bin/bash`. All the directories in matheus(oldusername) are okay. The only thing is that after restart my pc the only account that appears in the new one. Maybe if I delet the new username it will appear the old one when I restart?
Matheus Coelho avatar
br flag
But I'm a bit worried that if i delet new username and restart my pc it will go directly to a screen asking no create a new account
Matheus Coelho avatar
br flag
I'm logged in with the old username now, and when I go in configurations > users , the only user that appears is the new one
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.