Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I can't login as a guest. The screen goes to the black screen with blinking cursor for a second then straight back to login scree.

I can still log in as myself (administrator) and tried to create a new user. this failed too giving me the following message:

running '/usr/sbin/adduser' failed: /usr/sbin/adduser returned an error (1): useradd: cannot lock /etc/passwd; try again later.
adduser: `/usr/sbin/useradd -d /home/joe -g joe -s /bin/bash -u 1001 joe' returned error code 1. Exiting.

Any help much appreciated. I am running Ubuntu 11.10 on a netbook.

Thanks Matt

share|improve this question
    
I would post the output of cat /etc/passwd first to see if there's some obvious error. Before I went to copying someone else's /etc/shadow anyway. I would also sudo apt-get install lsof and lsof /etc/passwd –  hbdgaf Apr 18 '12 at 1:36
    
I removed /etc/*.lock and the problem seemed to have been solved. I'm not sure why /etc/*.lock are there in the first place. –  Tianyang Li Oct 27 '12 at 6:25

1 Answer 1

Please check that your /etc/passwd is not corrupted. If it is, replace it with a new file: I have provided a test-user known as testuser, the password is testtest for this temp user. Be sure to give change the testuser home directory to your home directory. I have bolded the location where you need to change the home directory. Leave everything else as is. Be sure to change these files as root and have a backup. Here is a clean /etc/shadow:

er wr root:!:15438:0:99999:7:::
daemon:*:15259:0:99999:7:::
bin:*:15259:0:99999:7:::
sys:*:15259:0:99999:7:::
sync:*:15259:0:99999:7:::
games:*:15259:0:99999:7:::
man:*:15259:0:99999:7:::
lp:*:15259:0:99999:7:::
mail:*:15259:0:99999:7:::
news:*:15259:0:99999:7:::
uucp:*:15259:0:99999:7:::
proxy:*:15259:0:99999:7:::
www-data:*:15259:0:99999:7:::
backup:*:15259:0:99999:7:::
list:*:15259:0:99999:7:::
irc:*:15259:0:99999:7:::
gnats:*:15259:0:99999:7:::
nobody:*:15259:0:99999:7:::
libuuid:!:15259:0:99999:7:::
syslog:*:15259:0:99999:7:::
colord:*:15259:0:99999:7:::
messagebus:*:15259:0:99999:7:::
lightdm:*:15259:0:99999:7:::
avahi-autoipd:*:15259:0:99999:7:::
avahi:*:15259:0:99999:7:::
usbmux:*:15259:0:99999:7:::
kernoops:*:15259:0:99999:7:::
pulse:*:15259:0:99999:7:::
rtkit:*:15259:0:99999:7:::
speech-dispatcher:!:15259:0:99999:7:::
hplip:*:15259:0:99999:7:::
saned:*:15259:0:99999:7:::
internetu::15439:0:99999:7:::
boinc:*:15440:0:99999:7:::
radvd:*:15442:0:99999:7:::
ntp:*:15442:0:99999:7:::
testuser:$6$sd3pG/1b$9mnB638HBFC8pMcNuftmwXYaV.omf.aPd6QubiGVtFPKRUMOTi5pKuaXlHgqVJKAZPjphUwsV8vUpLIAiVTNj/:15447:0:99999:7:::

And here is /etc/passwd

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
libuuid:x:100:101::/var/lib/libuuid:/bin/sh
syslog:x:101:103::/home/syslog:/bin/false
colord:x:102:105:colord colour management daemon,,,:/var/lib/colord:/bin/false
messagebus:x:103:107::/var/run/dbus:/bin/false
lightdm:x:104:108:Light Display Manager:/var/lib/lightdm:/bin/false
avahi-autoipd:x:105:112:Avahi autoip daemon,,,:/var/lib/avahi-autoipd:/bin/false
avahi:x:106:113:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/bin/false
usbmux:x:107:46:usbmux daemon,,,:/home/usbmux:/bin/false
kernoops:x:108:65534:Kernel Oops Tracking Daemon,,,:/:/bin/false
pulse:x:109:119:PulseAudio daemon,,,:/var/run/pulse:/bin/false
rtkit:x:110:122:RealtimeKit,,,:/proc:/bin/false
speech-dispatcher:x:111:29:Speech Dispatcher,,,:/var/run/speech-dispatcher:/bin/sh
hplip:x:112:7:HPLIP system user,,,:/var/run/hplip:/bin/false
saned:x:113:123::/home/saned:/bin/false
internetu:x:1002:1002:Internet user,,,:/home/internetu:/bin/bash
boinc:x:114:125:BOINC core client,,,:/var/lib/boinc-client:/bin/false
radvd:x:115:65534::/var/run/radvd:/bin/false
ntp:x:116:126::/home/ntp:/bin/false
testuser:x:1001:1001:testuser,,,,:/home/***CHANGE THIS TO YOUR OLD HOMEFOLDER***:/bin/bash
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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