I am connected to a Freebsd 10 -STABLE server with SSH from my office box but when I trying to work inside the session I encounter these problems:

  • although I did chsh for every user in said server to /usr/local/bin/bash; whenever I ssh to server I get:
    sh (the default Bourne shell in FreeBSD) supports command-line editing. Just ``set -o emacs'' or ``set -o vi'' to enable it.

  • in my ssh session I can't go to end of a line by End key or beginning of a line by Home key. instead I get ~ character. all and all the environment I feel in the SSH session is primitive and hard to navigate.

the echo $SHELL returns /usr/local/bin/bash.

the ps -ef|grep $$ returns:
2010 0 S 0:00.03 TERM=xterm PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/s


echo $0 returns su

  • @michas I edited the question – r004 Feb 16 '14 at 10:46
  • I'm not sure whether you have set /usr/loca/bin/bash as your default shell or are you currently running it on command line ? – X Tian Feb 16 '14 at 10:53
  • @XTian i change the shell by chsh for every user I have on that server and when i connect to server by vSphere Client i am in bash environment. – r004 Feb 16 '14 at 10:58
  • Please add the output of getent passwd $USER. Are you able to use chsh? Does /etc/shells contain bash? – michas Feb 16 '14 at 11:05
  • You said whenever I ssh to server I get: sh (the default Bourne shell in FreeBSD) .... Is that message in /etc/motd? – Mark Plotnick Feb 16 '14 at 11:56

According to the official FreeBSD documentation a regular chsh should do:

chsh -s /usr/local/bin/bash

The output about "... supports command line editing ..." probably comes from a fortune configured at your startup script. (It displays a random tip at login.)

  • but it doesn't affect the remote SSH connection – r004 Feb 16 '14 at 11:14
  • I do not understand your exact problem. SSH should start exactly the shell configured by chsh and displayed by getent. (see my comment above.) – michas Feb 16 '14 at 11:18
  • so there is something wrong at the client side? – r004 Feb 16 '14 at 12:42
  • 1
    Try to find out what shell you are running. echo $0, echo $SHELL or ps -ef|grep $$ might help you with that. I am pretty sure you are already running bash as a shell. – michas Feb 16 '14 at 13:06
  • 1
    If you do not run sudo after connecting to the FreeBSD system, do the editing characters still work? If you type control-A, does the cursor go to the beginning of the line? – Mark Plotnick Feb 16 '14 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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