Holy Mary of F*** UPS.

Holy Mary of F*** UPS.

Post by mitch hagert » Tue, 15 Jul 1997 04:00:00



Ok here is something a person new to root privileges should not do.

1. chmod 644 /etc/passwd
2. vi the /etc/passwd before creating new accounts
        on a freshly installed system
3. vi the root entry in /etc/passwd
4. forget to check and make sure csh is in /sbin and not /bin
        before logging out

As you can see above I am f**ked. When I login as root I get "No shell"
and it kicks me out. Is there anyway I can get around this without
having
to reinstall? Also I noticed there were already some entries in
/etc/passwd that were entered when I installed. Could someone pass along
those passwds so I can atleast get into my machine :). I am running
x86 Solaris 251 (du9). TIA for any help...

Mitch

 
 
 

Holy Mary of F*** UPS.

Post by Frank Peter » Tue, 15 Jul 1997 04:00:00



> Ok here is something a person new to root privileges should not do.
> 4. forget to check and make sure csh is in /sbin and not /bin
>    before logging out

> As you can see above I am f**ked. When I login as root I get "No shell"
> and it kicks me out. Is there anyway I can get around this without
> having

A common mistake.  In the future, I recommend doing the following
whenever changing root's entry in /etc/passwd:

Login and su in one window.
Login and su in another window, edit the passwd file and log out.
Login and su in the second window again to make sure you can
   still do so.
Logout of the first window.

This way you always have a fallback root shell in case of mistake.

For now however, you can boot from the CDROM and mount the root
filesystem on /a and then edit /a/etc/passwd and correct the root
entry.

Quote:> to reinstall? Also I noticed there were already some entries in
> /etc/passwd that were entered when I installed. Could someone pass along
> those passwds so I can atleast get into my machine :). I am running
> x86 Solaris 251 (du9). TIA for any help...

Those other accounts (bin and daemon and the like) are for administrative
purposes.  They aren't intended to be logged into and are locked by
default.

 
 
 

Holy Mary of F*** UPS.

Post by mitch hagert » Tue, 15 Jul 1997 04:00:00


Got my info thanks :)
mitch

 
 
 

Holy Mary of F*** UPS.

Post by Volker Borche » Thu, 17 Jul 1997 04:00:00



|> A common mistake.  In the future, I recommend doing the following
|> whenever changing root's entry in /etc/passwd:
|>
|> Login and su in one window.
|> Login and su in another window, edit the passwd file and log out.
|> Login and su in the second window again to make sure you can
|>    still do so.
|> Logout of the first window.
|>
|> This way you always have a fallback root shell in case of mistake.

And use vipw. It does some sanity checking as well as file locking.

        vb
--



 
 
 

Holy Mary of F*** UPS.

Post by Mason Wrigh » Thu, 17 Jul 1997 04:00:00



> Ok here is something a person new to root privileges should not do.

> 1. chmod 644 /etc/passwd
> 2. vi the /etc/passwd before creating new accounts
>         on a freshly installed system
> 3. vi the root entry in /etc/passwd
> 4. forget to check and make sure csh is in /sbin and not /bin
>         before logging out

> As you can see above I am f**ked. When I login as root I get "No shell"
> and it kicks me out. Is there anyway I can get around this without
> having
> to reinstall? Also I noticed there were already some entries in
> /etc/passwd that were entered when I installed. Could someone pass along
> those passwds so I can atleast get into my machine :). I am running
> x86 Solaris 251 (du9). TIA for any help...

> Mitch

Mitch,

On the Sparc version you boot from cdrom and then allow the install to
progress until you have a command prompt. You can then edit the
/etc/passwd file to your content. Re-boot and you have not affected any
installed software of configurations.

Hope this works on x86.

Mason

 
 
 

Holy Mary of F*** UPS.

Post by David Dru » Fri, 18 Jul 1997 04:00:00



> For now however, you can boot from the CDROM and mount the root
> filesystem on /a and then edit /a/etc/passwd and correct the root
> entry.

Specifically, just to help the guy out:
boot cdrom -sw
then mount your root partition on /a and go.

Regards,

David K. Drum

--
"That man has a rare gift for obfuscation." -- ST:DS9 * "It's hard to
be bored when you're as stupid as a line." -- Vernor Vinge * "Reality
has a tendency to be so uncomfortably real." -- Neil Peart * "You can
only measure the size of your head from the inside." -- Larry Wall

 
 
 

Holy Mary of F*** UPS.

Post by Dan Abarbane » Fri, 18 Jul 1997 04:00:00




> > Ok here is something a person new to root privileges should not do.

[...]
> > As you can see above I am f**ked. When I login as root I get "No shell"
> > and it kicks me out. Is there anyway I can get around this without
> > having
> > to reinstall?

[ ...]

Just a note, beyond the sound advice to start install from CD-ROM, then
edit /etc/password: If you want root to use a shell other than the
(still) standard "/sbin/sh", you should create an 'alternate root' user,
which has the exact same entry in /etc/passwd [and /etc/shadow if it's
that kind of a system], only with /sbin/sh as its shell. This way, if
"root" gets hosed with a 'No shell' message, just login as "altroot"
(or whatever you choose to call it), get the sh # prompt, and hack
away until root can login again.

e.g: (excerpt from my own /etc/password)

root:x:0:1:0000-Admin(0000):/:/bin/tcsh
altroot:x:0:1:[Alternative Root]:/:/sbin/sh

The two root NEEDN'E necessarily even share the same password, (or even
group) if that worries you for some reason... Just both have to be uid
0. You can even set root's home directory (NOT altroot's!) to someplace
other than '/' (but then make sure it has it's own startup files, just
like any old user in the system)

Hope this helps
Dan

--
======================================================================
Dan Abarbanel                 | "Warning: Dates in the calendar are
Madge Networks ESD, Israel    |  closer than they appear!"
Tel: +972 3 6457662           |
Fax: +972 3 6487146           |

 
 
 

Holy Mary of F*** UPS.

Post by Ed Rav » Sat, 19 Jul 1997 04:00:00



>> Ok here is something a person new to root privileges should not do.
>> 4. forget to check and make sure csh is in /sbin and not /bin
>>        before logging out

>> As you can see above I am f**ked. When I login as root I get "No shell"
>> and it kicks me out. Is there anyway I can get around this without
>> having

Next time, use "vipw" -- it checks for things like that and won't
update the password file if root has a bad login shell or its home
directory isn't "/".
--
Ed Ravin        |If I were not a little mad and generally silly

                |I should show you in a moment how to grapple with the question
                |And you'd really be astonished at the force of my suggestion.