fixing /etc/passwd

Benjamin Minshall minshal1@pilot.msu.edu
Tue, 25 Dec 2001 01:39:39 -0500


I have two suggestions:

(1) Try editing /etc/passwd and /etc/group by hand with your favorite text
editor.

(2) You may need to escape the "$" on the shell prompt with "\$" like:
useradd -g machines -c NTMachine -d /dev/null -s /bin/false sa\$

-Ben

> -----Original Message-----
> From: linux-user-admin@egr.msu.edu
> [mailto:linux-user-admin@egr.msu.edu]On Behalf Of Marcel Kunath
> Sent: Tuesday, December 25, 2001 1:21 AM
> To: linux-user@egr.msu.edu
> Subject: fixing /etc/passwd
>
>
> Hello,
>
> I mucked up my user setup in the passwd file.
>
> I added a machine for a PDC. I later deleted it and I must have
> done it the
> wrong way. I now try to add it again and it fails.
>
> The name is
>
> sa$
>
> The files /etc/passwd and /etc/shadow don't have it referenced in it.
>
> I do a
>
> # useradd -g machines -c NTMachine -d /dev/null -s /bin/false sa$
> useradd: user sa$ exists
>
> # usermod -g machines -c NTMachine -d /dev/null -s /bin/false sa$
> usermod: sa$ not found in /etc/passwd
>
> # userdel sa$
> userdel: error deleting password entry
> userdel: error deleting shadow password entry
>
> # groups sa$
> sa$ : machines
>
> How is this fixable?
>
> Thanks,
>
> mk
> _______________________________________________
> linux-user mailing list
> linux-user@egr.msu.edu
> http://www.egr.msu.edu/mailman/listinfo/linux-user