0

So I wanted to change the name of the home folder, and did so using the mv command: mv /home/oldname /home/newname. It worked fine. No errors appeared until I tried accessing the home folder. It said it couldn't find /home/oldname (I don't remember the full error).

I though I could fix it easily by editing the passwd file. I searched for passwd within the /etc directory and found a few results. I just double clicked the first result (I know it's stupid) and then the file explorer exited. I couldn't click on anything and nothing was working, so I rebooted the computer. When I came to the login screen, I entered my password and pressed enter. The screen went black for a while, and then returned to the login screen. Basically I can't login my main account, I can only use Guest, which deletes any changes to Ubuntu on exit. If anyone knows how I can edit the passwd file from there or fix it in another way, that'd be great. I know this might be a duplicate, but non of the questions I found were using the same command as me which might make a difference. Also please note that I don't want to rein

0

Your initial guess was correct - you need to change the home directory entry in /etc/passwd file. That means you can either use sudo vipw or sudo sed -i 's;/home/oldName;/home/newName;' /etc/passwd in terminal. To access virtual terminal press CtrlAltF2 (or any F key from 1 to 6), and login there.

  • Thanks a lot, it worked! And on top of that, I get to keep the name change too! – bf beats cod Sep 15 '15 at 18:15
  • I didn't know about vipw... – Fabby Sep 15 '15 at 18:42
  • @Fabby I didn't know either until muru taught me :) he's all about vim – Sergiy Kolodyazhnyy Sep 15 '15 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.