# bsd no login



## bluethundr (Aug 18, 2010)

unfortunately I seem to have hit a brick wall logging into my FreeBSD box either remotely or locally. I would love to provide conf files and logs, however without the ability to login that's kinda hard. x( 


Does anyone have any suggestions for how to proceed short of a reinstall?



```
[root@lcent5-1:~]$:bsd2
Last login: Tue Aug 17 12:09:45 2010
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
	The Regents of the University of California.  All rights reserved.

FreeBSD 8.0-RELEASE (GENERIC) #0: Sat Nov 21 15:48:17 UTC 2009

#########################################################
#               SUMMITNJHOME.COM                        #
#               TITLE:       FreeBSD 2 BOX              #
#               LOCATION:    SUMMIT BASEMENT            #
#                                                       #
#########################################################


/libexec/ld-elf.so.1: Shared object "libiconv.so.3" not found, required by "bash"
Connection to 192.168.1.44 closed.
[root@lcent5-1:~]$:
```

And here is the verbose output from an SSH command.

http://pastie.org/1100263

Thanks!!


----------



## DutchDaemon (Aug 18, 2010)

Boot in single-user mode, mount your filesystems ->


```
fsck -y
mount -u /
mount -a -t ufs
swapon -a
```

-> run chsh(1) to change shell back to csh (for root) and tcsh (for user)s)). Don't use bash as the shell for *all* wheel users (leave at least *one* wheel account on the default shell) and root. Activate and use the toor account if you really need a bash shell for root.

Upgrade your ports tree and your ports, keeping an eye on /usr/ports/UPDATING.


----------



## bluethundr (Aug 18, 2010)

*I'll give it a go!*

Thanks DD! I'll give that a go and let you know. I'll have to try this tonight when I get home from work. Just out of curiosity is there any particular reason as to why bash is deprecated for root or for that matter for any user? :\


----------



## DutchDaemon (Aug 18, 2010)

Bash is not deprecated, changing the root shell has never been advisable (_especially_ on systems that are not local), and it's been discussed dozens of times on the forums. Here's just two exemplary threads: http://forums.freebsd.org/showthread.php?t=14676 http://forums.freebsd.org/showthread.php?t=2194


----------



## lme@ (Aug 18, 2010)

bluethundr: If bash doesn't work, try
`% ssh -t bsd2 /bin/sh`
Then you have an interactive session with sh(1)().


----------



## bluethundr (Aug 18, 2010)

*continuing login woes*

Greatly clarified DD! Thanks!

lme@:

no love here: 


```
[root@lcent5-1:~]$:ssh -t $BSD2 /bin/sh
/libexec/ld-elf.so.1: Shared object "libiconv.so.3" not found, required by "bash"
Connection to 192.168.1.44 closed.
```


----------



## bluethundr (Aug 19, 2010)

*login FTW*

DD and others, thanks for your help!

Sorry for the false alarm, but the last time I experienced a similar issue to this one I was not able to login locally as well as remotely. 

So when I SSH'd into the box from work and saw this error I feared the worst.

But very luckily when I returned home I noticed I was still logged in! :r

So (as root) I typed in exec bash which returned the same error. 

So I, very simply, typed 


```
chsh -s /bin/csh
```

Which got me into a safe cshell. 

I then went:


```
/usr/ports/shells/bash make deinstall
```

then

```
/usr/ports/shells/bash make clean && make install config clean
```

Then su'd to my user account


```
su - bluethundr
```

And typed exec bash and all was well.

Thank you for your patient tutelage!


----------

