Recover Admin and user passwords to login to system

Asked by Roger Figgis

Do not know admin and user passwords for a Ubuntu server, is there a way to recover? I have been ask to try and restart a web server running Ubuntu. We do not know the passwords, the previous admin person has moved on and we are unable to contact him. Is there a way to solve this without rebuilding the server and loosing the applications and date it contains?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu shadow Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#1

Reboot and hold shift at start, select recovery mode then select root. You can now run:
cd /home; ls

you can now see your username(s) and can run:
passwd foo

(Change foo for your actual username)

Follow the prompts then run:
reboot

and you will be able to log in as foo with the password you set. The data the server contains should be BACKED UP so a rebuild would not lose this at all. You do not need to reinstall for a simple password change. (You can even reset the local administrator password on WIndows systems with a tool)

Revision history for this message
Roger Figgis (roger-figgis) said :
#2

Thanks that worked but I now have the following problem, after I rebooted and logged I got the following messages;

Could not Update ICEauthority file /home/username/.ICEauthority

I clicked on the OK button (the only option)
then;

There is a problem with the configuration server (/usr/lib/libconf2-4/gconf-sanity-check-2 exited with status 256)

I clicked on the OK button (the only option)
then;

Nautitlus could not create the following required folders /home/username/Desktop, /home/username/.nautilus.

I clicked on the OK button (the only option)
then;

Before running Nautilus, please create these folders or set the permissions such that Nautilus can create them.

Have I stuffed this build by changing the password or was it already broken, there is nothing on the screen but colored background, no icons, and neither right or left mouse click shows anything. The screen does go to sleep and the new passwd will get me back to a the screen with out icons to uses, anyone got any suggestions.

Thanks

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Do you use commands like:

sudo gedit
sudo nautilus

basically using GUI apps with sudo?

Revision history for this message
Roger Figgis (roger-figgis) said :
#4

Sorry I am quite new to linux, have done work with HPUX and VMS but am a bit
lost here. Not sure how, as I have no way to enter anything on the screen.
I have what I assume is the ubuntu background, and nothing else, Right nor
left click results in any thing and just typing on the keyboard is not doing
anything. Should I go back the start options as per the first messsge and
do a recover?
Thanks
Roger.

On 22 March 2011 16:03, actionparsnip
<email address hidden>wrote:

> Your question #149992 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/149992
>
> actionparsnip posted a new comment:
> Do you use commands like:
>
> sudo gedit
> sudo nautilus
>
> basically using GUI apps with sudo?
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

press:

CTRL+ALT+T

Does it show a terminal?

You didn't answer my previous question either....

Revision history for this message
Roger Figgis (roger-figgis) said :
#6

Sorry the direct reply to your question is no, I don't use sudo gedit or
sudo nautilus.

CTRL+ALT+T worked, I have a terminal, so should I try a sudo nautilius to
get a functioning GUI?

On 22 March 2011 16:16, actionparsnip
<email address hidden>wrote:

> Your question #149992 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/149992
>
> actionparsnip posted a new comment:
> press:
>
> CTRL+ALT+T
>
> Does it show a terminal?
>
> You didn't answer my previous question either....
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#7

No NEVER use sudo with gui apps, use gksudo. To now repair your permission mess you will need to run:

cd /home; sudo chown -R $USER:$USER ./$USER

and your user's data will be given back as you have borked it somewhere along the lines. There will be a few warnings but they are normal, you can then reboot with:

sudo reboot

and things may be ok

Revision history for this message
Roger Figgis (roger-figgis) said :
#8

Thanks for your help, I have done that but didn't get any warnings. The
errors about the ICEauthority file and nautilus are still happening, so I
think it may be stuffed.

On 22 March 2011 16:45, actionparsnip
<email address hidden>wrote:

> Your question #149992 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/149992
>
> actionparsnip posted a new comment:
> No NEVER use sudo with gui apps, use gksudo. To now repair your
> permission mess you will need to run:
>
> cd /home; sudo chown -R $USER:$USER ./$USER
>
> and your user's data will be given back as you have borked it somewhere
> along the lines. There will be a few warnings but they are normal, you
> can then reboot with:
>
> sudo reboot
>
> and things may be ok
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#9

did you run the command as I gave it?

Revision history for this message
Roger Figgis (roger-figgis) said :
#10

yep, just as you gave it. I reset the password for one of the guest user
accounts and when loging to that account the gnome desktop comes up and
there is data there, it would seem it is just the admin account that has
problems with its desktop.

On 22 March 2011 17:14, actionparsnip
<email address hidden>wrote:

> Your question #149992 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/149992
>
> actionparsnip posted a new comment:
> did you run the command as I gave it?
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#11

I suggest you check ownerships of files and suchlike within the home folder, see what's going on

Revision history for this message
Roger Figgis (roger-figgis) said :
#12

It is interesting, the admin accounts /home only has two files in it, and
looking at the readme file it would seem the admin account has been setup
using a program "ecryptfs" as it is saying to open the desktop data file do
"encryptfs-mount-private" which in turns asks for a passphrase. I think I
am very stuffed at this point.
Will have to look up about "encryptfs". Is there a way to use a different
window manager for the admin account?

PS.
I have done a gksudo nautilus and got a form of file manager that seems to
show the admin account data, so I may be OK. - I hope.

Thanks for your help.
Roger.

On 22 March 2011 17:29, actionparsnip
<email address hidden>wrote:

> Your question #149992 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/149992
>
> actionparsnip posted a new comment:
> I suggest you check ownerships of files and suchlike within the home
> folder, see what's going on
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>