[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to login to a machine with invalid shell in /etc/passwd?



Craig Anderson wrote:
> Helu,
> 
>   No.. unfortunately this will exit since it checks for a valid shell
> before invoking "/path/to/bash".
> 
>   Heh..  I am still on the OpenBSD mailing list right?
> 
> o_0
> 
> -- Craig

Hmm...

[16:11:51][kevin@tokyo:~]$ su - root
Password: 
Jan  2 16:11:56 tokyo su: 'su root' succeeded for kevin on /dev/pts/9
Sun Microsystems Inc.   SunOS 5.7       Generic October 1998
# which sh
/usr/bin/sh
#/usr/ucb/vipw

[changed /bin/sh to /bin/ash] (non-existant shell)
:wq
"/etc/ptmp" 15 lines, 573 characters 
Invalid root shell:
root:x:0:1:Super-User:/:/sbin/ash
vipw: you mangled the /etc/ptmp file, /etc/passwd unchanged
Invalid root shell:
root:x:0:1:Super-User:/:/sbin/ash
vipw: you mangled the /etc/ptmp file, /etc/passwd unchanged

-Kevin