?
Solved

Re-Enabling User Account After Upgrading Ubuntu Linux from 10.10 to 12.04LTS

Posted on 2013-06-07
12
Medium Priority
?
685 Views
Last Modified: 2013-06-08
Just upgraded a desktop PC from Ubuntu 10.10 to 12.04LTS using CD install (online update failed).

I am able to boot up into the new account (which I called test) I created during the upgrade. But I cannot log into the original account (called richard).

From Terminal, I see there is a /home/richard directory where I can see all the user files.

How can I re-enable that richard account?
0
Comment
Question by:anuneznyc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 2
  • 2
12 Comments
 
LVL 79

Assisted Solution

by:arnold
arnold earned 1332 total points
ID: 39230825
see if richard is actually in /etc/passwd

If it is not, re-add the user.

useradd -d /home/richard richard
0
 

Author Comment

by:anuneznyc
ID: 39230835
Thank you, Arnold.

No, richard is not in /etc/passwd

Does "useradd -d /home/richard richard" just add that required entry into the passwd file? Or does it create new directories? Obviously I don't want the original /home/richard directory to be over-written. Excuse my inexperience. Not very well-versed in Linux.
0
 
LVL 30

Accepted Solution

by:
Kerem ERSOY earned 668 total points
ID: 39230864
Then you'll need to add richard as arnold points out.

Then check the home directory and if the uid / gid is the same as your previous installation.. You can check this using :

ls -al /home

Open in new window


If richard directory is owned by user and group richard then it is the same uid/gid with your recent system. But if you see it is owned by another user or just see a number instead of uid/gid then you'll need to change owner of the home directory to richard using this command:

chown -vR richard:richard /home/richard

Open in new window


This should do to set the user home owned by the new richard account.

Cheers,
K.
0
Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

 

Author Comment

by:anuneznyc
ID: 39230889
I'm getting the error, "useradd: cannot lock /etc/passwd; try again later." when I enter "useradd -d /home/richard richard" in Terminal.
0
 

Author Comment

by:anuneznyc
ID: 39230894
When I enter "ls -al /home" these are the results:

drwxr-xr-x  5 root root 4096 Jun  7 19:22 .
drwxr-xr-x 24 root root 4096 Jun  7 19:40 ..
drwxr-xr-x 56 test test 4096 Jun  7 18:45 richard
drwxr-xr-x  2 rw   rw   4096 Jun  7 19:22 rw
drwxr-xr-x 24 test test 4096 Jun  7 19:54 test
0
 

Author Comment

by:anuneznyc
ID: 39230909
Oh wait. Ran "useradd -d /home/richard richard" using sudo and this time it worked.
0
 

Author Comment

by:anuneznyc
ID: 39230949
OK. I've now managed to get richard to show up as one of the login items when I first start Ubuntu. But then it wouldn't accept the original password for this account. So I ran "sudo passwd richard" to reset it.

Now it accepts that password. However, after it spends around 5 seconds trying to get to the desktop, it simply dumps me back at the initial login screen.
0
 

Author Comment

by:anuneznyc
ID: 39230953
Just ran "chown -vR richard:richard /home/richard" to change ownership as per KeremE's suggestion.

Going to try logging out of test and back in as richard.
0
 

Author Comment

by:anuneznyc
ID: 39230974
Don't like Unity desktop.

How can I revert 12.04 back to Gnome desktop?
0
 
LVL 79

Assisted Solution

by:arnold
arnold earned 1332 total points
ID: 39231006
Likely when it upgraded it asked whether to retain existing user or create new one,
It seems the passwd file was overwritten.
You need to run sudo passwd richard to set a new password.

This should be it.
The useradd reset the gid/uid on the directory when it already exists.
0
 

Author Closing Comment

by:anuneznyc
ID: 39231081
Thanks Guys! I'm good to go!
0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 39231452
You're welcome.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month15 days, 2 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question