FreeBSD
Files
The /etc/master.passwd file stores both the user account info and their hashed passwords (is the merged version of passwd and shadow files in Linux). FreeBSD uses tools like vipw or pw to manage the /etc/master.passwd file:
The
wheelgroup is the equivalent Linuxsudogroup.
# Create the user bob and add him to the wheel group
sudo pw useradd bob -m -s /bin/tcsh -G wheel
# Set the user's password
sudo passwd bob
# Add an existing user to an existing group
pw groupmod wheel -m bobNetworking
General networking information, such as interfaces, IP addresses, and DNS:
ifconfigCheck recent communications via the ARP table:
arp -aList active connections:
# List active sockets
$ sockstat -4lList recent and persistent routes:
netstat -rn
route -nDoas
doas is a simplified alternative to sudo, originally from OpenBSD, and available on FreeBSD via ports/packages. Its job is to let users run commands as another user (often root) with fine-grained permissions defined in /usr/local/etc/doas.conf.
# Enumerate doas permissions
$ cat /usr/local/etc/doas.conf
...
# Permit members of the wheel group to perform actions as root.
permit nopass :wheel
# Add an existing user to an existing group
doas pw groupmod wheel -m bobLast updated
Was this helpful?