Ubuntu, User Accounts messed up

Posted by Vor on Ask Ubuntu See other posts from Ask Ubuntu or by Vor
Published on 2012-09-25T15:02:42Z Indexed on 2012/09/25 15:50 UTC
Read the original article Hit count: 645

I need to fix Ubuntu Accounts some how but don't really see how it could be done.

The problem is: files /etc/passwd and /etc/hostname and /etc/hosts where changed. /etc/passwd

After

John:x:1000:1000:John,,,:/home/serg:/bin/bash

Befoure

serg:x:1000:1000:John,,,:/home/serg:/bin/bash

/etc/hosts

After

127.0.0.1       localhost
127.0.1.1       John-The-Rippe

Befoure

127.0.0.1       localhost
127.0.1.1       serg-Protege

/etc/hostname

After

John-The-Ripper

Befoure

serg-PORTEGE-Z835

I was trying to simply changed this files but can not do this because permission denied. When I'm trying to login as a root I got this message:

John@John-The-Ripper:~$ sudo -s
[sudo] password for John: 
John is not in the sudoers file.  This incident will be reported

The file sudoers is empty:

John@John-The-Ripper:~$  vi /etc/sudoers

When I type users in cp:

John@John-The-Ripper:~$ users
John John

When I type id, I got this:

John@John-The-Ripper:~$ id
uid=1000(John) gid=1000(serg) groups=1000(serg)

This doesn't work eather:

John@John-The-Ripper:~$ usermod -l John serg
usermod: user 'serg' does not exist
John@John-The-Ripper:~$ adduser serg
adduser: Only root may add a user or group to the system.
ater.

Then I tried to go to the GRUB menu and from there log in as a root. I did this, but however When I tryed to create user serg, It gave me an error that group already exist. When I tried to change /etc/passwd it said 'permission denied'

And this doens't do the trick:

John@John-The-Ripper:~$ visudo
visudo: /etc/sudoers: Permission denied
visudo: /etc/sudoers: Permission denied

Also The last thing I tried to do is to create a bootable USB and reinstall ubuntu, however I can not open USB-Creator because it asked me a root passwd. But it doesn't work.

HELP ME PLEASE =)))

© Ask Ubuntu or respective owner

Related posts about 12.04

Related posts about user-accounts