Get access to csh (default freebsd shell) for root to solve login problem.

Subhro Kar subhro.kar at gmail.com
Mon Jul 5 01:30:26 UTC 2010


On 04-Jul-2010, at 9:48 PM, Thomas Keusch wrote:

> On Sun, Jul 04, 2010 at 05:02:59PM +0100, Luca Renaud wrote:
> 
> Hi,
> 
>> The root shell is now bash,but I was unaware that bash was not
>> self-contained(it depends at least of libintl.so.8),
>> and doing some upgrades with ports I erased libintl.so.8,now I cannot access
>> the root account because bash is
>> not operational and I need root access to install again libintl.so.8,or any
>> other way to solve the problem.
>> So,how can I get access to csh for root without having access to a root
>> shell(the previously defined bash does
>> not work,and I need root access to change the shell for the root acount).
> 
> if you haven't activated the 'toor' account (another UID 0 account besides
> root), you'll have to boot from fixit media (or another live cd / system) and
> go from there.

I think that would be an overkill. From the su(1) manpage, 

     -m      Leave the environment unmodified.  The invoked shell is your
             login shell, and no directory changes are made.  As a security
             precaution, if the target user's shell is a non-standard shell
             (as defined by getusershell(3)) and the caller's real uid is non-
             zero, su will fail.


So, you could use su -m to switch to root and remain in the same shell as your user calling su. Once there, AFAIK, you could use vipw(8) or chsh(1) to change the root shell back to csh.

Thanks
Subhro

--
Subhro Kar

Blog: http://80386.org
Twitter: http://twitter.com/subhrokar
FaceBook: http://www.facebook.com/subhrokar


More information about the freebsd-questions mailing list