Add and Remove Users
- Create users using the
adduser
interactive utility:
$ sudo adduser
Username: john
Full name: John Doe
Uid (Leave empty for default):
Login group [john]:
Login group is sammy. Invite sammy into other groups? []: wheel
Login class [default]:
Shell (sh csh tcsh nologin) [sh]:
Home directory [/home/john]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Enter password: (add password)
Enter password again: (add password)
Lock out the account after creation? [no]:
- Remove user using the command
rmuser
. - To lock a user account use:
sudo pw lock username
- To unlock a user account use:
sudo pw unlock username
Change keymap
# bsdconfig
look for option 7 Console > Keymap.
Check Vulnerabilities
“FreeBSD maintains a vulnerability database that should be checked regularly to ensure that there are no vulnerabilities in the software you have installed on your system.
While it is sometimes beneficial to update all of the software on your system, at the very least, any software with known vulnerabilities should be updated at the earliest possible time. To check for known vulnerabilities with any of the optional software you have installed on your system, type:
# pkg audit -F
This will download the latest vulnerability database from the FreeBSD servers and check it against the installed software on your system. If any vulnerabilities exist with your installed software, it will alert you.”
Compilers
When we get this error cc: error: no such file or directory: 'CXX=c++'
it’s
because the build routine can’t find a compiler. In order to fix this, if we
want to use GCC type: $ CC=gcc
and $ CXX=g++
or CXX=c++
in order to use
Clang.
Error: Adding new user - pw: user ‘****’ disappeared during update
Your databases are out of sync. Not sure how this happens but I get it from time
to time too. Run /usr/sbin/pwd_mkdb -p /etc/master.passwd
. Running
vipw(8)
and save-and-quit (without actually making any changes) also fixes it (easier to
remember).
Error: What to do if pkg
can’t find their .so
files
Updating FreeBSD from 11.2 to 12.1 pkg
got broke, with a message complaining
about a missing .so
file.
In this case, we must type:
# pkg-static install -f pkg
Once we reinstall pkg
, we can update and upgrade all packages.
Install Haskell Stack
$ wget -qO- https://get.haskellstack.org/ | sh
$ echo "export PATH=\"\$PATH:~/.local/bin\"" >> ~/.profile
$ source ~/.profile
Install nvm
$ sudo pkg install gcc7 gmake
$ export CC="gcc7" CXX="g++7" CPP="cpp7" CFLAGS="-std=c++11"
$ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
$ nvm install --lts=carbon
$ echo "nvm use --delete-prefix v8" >> ~/.profile
$ source ~/.profile
Install Ports
# portmaster group/port
# portmaster --force-config
Update and Upgrade the OS
# freebsd-update fetch
# freebsd-update install
Update packages
In order to update packages at freebsd, you need to run this command as root.
# pkg upgrade