[ubuntu-uk] Password recovery

Lucy lucybridges at gmail.com
Mon Jul 7 20:54:15 BST 2008

On 07/07/2008, Keith <keith at grumpyface.me.uk> wrote:
> Thanks for the suggestions.
>  I do have root access and I had already tried sudo passwd .... and I get
>  the response "passwd: unknown user (user2)".  That is why I had also
>  tried "System->Administration->Users and Groups" to add (user2).  The
>  response to that was "Home directory already exists".  I have tried to
>  change the name of that directory without success.


I don't have the thread in front of me but I seem to remember you
reinstalling or similar at some point? It sounds like user2 has been
removed from the system but its data hasn't. The easiest thing to do
might be to rename the home directory, readd the user and then copy
the data back across.

So, in a terminal type:
sudo mv /home/user2 /home/user2-tmp

Then go to "System->Administration->Users and Groups" to add user2.

Then do:
sudo cp -a /home/user2-tmp/ /home/user2
The -a should keep the permissions intact (assuming the new user2 has
the same user id as the previous user2). I think it will also copy all
of the hidden (.*) files, but can't remember off the top of my head so
it might be worth checking.

More information about the ubuntu-uk mailing list