May 25, 2017

How to Install Bash Shell on FreeBSD

FreeBSD Logo

FreeBSD uses the C Shell (tcsh) as default. For security reasons, it is better to use C Shell for the root user. Nevertheless, you can install and use Bash simply by installing a port.

Root access is required to edit the following files and to execute commands. Log in as root (su) or simply prepend sudo to all commands that require root privileges.

Install Bash

With the following commands you will install the bash port:

portsnap fetch
cd /usr/ports/shells/bash
make install clean; rehash

Start Bash

Run the bash shell:

/usr/local/bin/bash

Set Bash as default Shell

chsh -s /usr/local/bin/bash {username}
# Where {username} for example stan

You can set the shell manually in /etc/passwd

stan:*:1001:1001:User &:/home/stan:/usr/local/bin/bash

Speak Your Mind