Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I managed to do something catastrophically stupid and below rookie level.

Clean install on my FreeBSD VPS, then upgraded to version 9.1 (from 9). For some unusual reason, rather than installing screen first, I installed bash through pkg.

Then I changed the shell for both my user AND root. Now when I tried to log back in, on both accounts, and they are the only two accounts, I get a strange error that my google-fu has not been able to procure an answer. I get "/usr/local/bin/bash: Undefined symbol "_ThreadRuneLocale"% " after typing in the password and the. I get booted off the server. I tried doing the same through the console.

Now that I've managed to lock myself out of my account as well as root, genius that I am, I'm wondering if there's a way to login with a different shell but bypassing this problem.

When I try ssh @ -i /bin/sh .. still no go, it gives me the exact same error.


share|improve this question
Maybe try using sftp to overwrite /etc/passwd or /bin/bash? – Kenster Apr 30 '13 at 14:25
My Google Fu tells me that this is most likely a borked update. So rerunning the update (if possible, never did BSD) might be a solution...if you can login again, that is. – Bobby Jun 17 '13 at 10:50
up vote 2 down vote accepted

Is this a full virtual machine, or a FreeBSD jail VPS? If the former, does your provider offer OOB access to the VM's console? If so, reboot the server into single user which uses /bin/sh by default, and from there you can set your root shell back to /bin/csh using chsh or vipw as you prefer.

If your VPS is a FreeBSD jail, or you don't have OOB console access, you'll need to get in touch with your provider's support team and ask them to set your root user's shell back to /bin/csh. They should be able to do this for you with minimal fuss.

If you really want to use bash as your root shell, use the toor user instead or root - it's provided for just such purposes, so you can set up a comfortable environment without the risk of locking yourself out. However, I prefer to leave root exactly as is, as a reminder that I am operating with elevated privileges.

share|improve this answer

ssh will always use the configured shell after logging in and then use that to start the program you requested. What you would need is a different subsystem to start. By default there is ssh and sftp, and you could try and add your own in /etc/ssh/sshd_config:

Subsystem  binsh /bin/sh

(by downloading /etc/ssh/sshd_config using sftp, modifying it, uploading it again, and rebooting the machine somehow) and then select that using

ssh -s /bin/sh <machine> -l <account>

Note: Untested, i.e. if it breaks you get to keep the pieces.

share|improve this answer
According to O'Reilly·, the valid syntax would be: ssh -s binsh <machine> -l <account> – Jaime M. Mar 9 '15 at 14:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.