OpenBSD

OpenBSD Cheatsheet #

OpenBSD is a secure, free, and open-source Unix-like operating system based on the Berkeley Software Distribution (BSD). Known for its emphasis on security, code correctness, and comprehensive documentation, OpenBSD is widely used for building reliable and secure systems. Below is a comprehensive cheatsheet to help you get started with OpenBSD, covering various commands and their descriptions.

System Information and Management #

CommandDescription
uname -aDisplay all system information
sysctl -aDisplay all kernel state information
dmesgShow system boot messages
topDisplay real-time system information
ps auxList all running processes
pkg_infoList installed packages
pkg_add -v <package_name>Install a package
pkg_delete <package_name>Remove a package
doas <command>Run a command with superuser privileges

User and Group Management #

CommandDescription
adduserAdd a new user
userdel <username>Delete a user
usermod -G <group> <username>Add a user to a group
groupadd <group>Create a new group
groupdel <group>Delete a group
passwd <username>Change a user’s password

Network Management #

CommandDescription
ifconfigDisplay or configure network interfaces
ping <hostname/IP>Send ICMP ECHO_REQUEST to network hosts
netstat -rDisplay the routing table
route add <destination> <gateway>Add a static route
pfctl -eEnable the packet filter
pfctl -dDisable the packet filter
pfctl -srShow active packet filter rules

Disk Management #

CommandDescription
df -hDisplay disk usage in a human-readable format
du -sh <directory>Show disk usage of a directory
mountDisplay all mounted filesystems
mount /dev/<device> <mount_point>Mount a filesystem
umount <mount_point>Unmount a filesystem
fdisk -lList all partitions on a disk
newfs /dev/<device>Create a new filesystem on a device

System Services and Daemons #

CommandDescription
rcctl start <service>Start a service
rcctl stop <service>Stop a service
rcctl restart <service>Restart a service
rcctl enable <service>Enable a service to start at boot
rcctl disable <service>Disable a service from starting at boot
rcctl status <service>Check the status of a service

File Operations #

CommandDescription
cp <source> <destination>Copy files or directories
mv <source> <destination>Move or rename files or directories
rm <file>Delete a file
rm -r <directory>Delete a directory and its contents
chmod <permissions> <file>Change file permissions
chown <owner>:<group> <file>Change file owner and group
ln -s <target> <link>Create a symbolic link

This cheatsheet covers a range of essential commands for system information, user management, network management, disk management, system services, and file operations in OpenBSD. For detailed information on each command, refer to the OpenBSD manual pages using the man <command> command.

OpenBSD

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.