`sudo lshw`
`sudo lshw -businfo`
- CPU physcial info:
sudo lshw -businfo | grep cpu
- CPU details:
cat /proc/cpuinfo
- CPU architecture:
lscpu | grep -i arch
- CPU detailed info:
cpuid
- RAM physical info:
sudo lshw -businfo | grep memory
- Total and available memory:
free -h -t
- Get total memory:
grep -i memtotal /proc/meminfo
- Disk size and model:
sudo lshw -businfo | grep disk
- Disk space and its partitions:
lsblk -p
- Disk space info:
df -h
- Disk partitions size and fs human-readable:
parted -l
- Partition UUIDs:
blkid
- Partitioning the disks:
cfdisk
- Network physical info:
sudo lshw -businfo | grep network
lspci -v
sudo lsusb -v
lsmod
lsmod | grep ath
sudo modprobe <module>
sudo modprobe -r <module>
rfkill list
sudo lshw -C network
lspci -v | grep Ethernet
sudo iwconfig
ip addr
ifconfig <interface> up
# other options ifup/ifdown and nmcli (if installed)
sudo iwlist <interface> scan
# set SSID and passphrase:
wpa_passphrase <your-ESSID> <your-passphrase> | sudo tee /etc/wpa_supplicant/wpa_supplicant.conf
# Remove plain text password from wpa_supplicant.conf file:
sudo sed -i '/#psk/d' /etc/wpa_supplicant/wpa_supplicant.conf
# Run wpa_supplicant in the background:
sudo wpa_supplicant -B -c /etc/wpa_supplicant/wpa_supplicant.conf -i <interface>
# Check if connected:
iwconfig
# look for value next to Access Point
sudo dhclient <interface>
sudo cp /lib/systemd/system/wpa_supplicant.service /etc/systemd/system/wpa_supplicant.service
# Replace line starting with ExecStart with the following:
ExecStart=/sbin/wpa_supplicant -u -s -c /etc/wpa_supplicant.conf -i <interface>
# Add the following right after to restart on failure
Restart=always
# comment out the following
Alias=dbus-fi.w1.wpa_supplicant1.service
# enable wpa_supplicant service to run at boot
sudo systemctl enable wpa_supplicant.service
Enable DHCP client at start-up sudo nano /etc/systemd/system/dhclient.service # with the following content:
[Unit]
Description= DHCP Client
Before=network.target
[Service]
Type=forking
ExecStart=/sbin/dhclient <interface> -v
ExecStop=/sbin/dhclient <interface> -r
Restart=always
[Install]
WantedBy=multi-user.target
# Enable dhclient service
sudo systemctl enable dhclient.service
sudo nano /etc/dhcp/dhclient.conf
# Add the following:
interface "<interface>" {
send dhcp-requested-address <ip-address>;
}
systemctl restart network
# or
systemctl restart network.service
free -m
systemctl enable ssh
systemctl start ssh
ssh-keygen -f /etc/ssh/ssh_host_ed25519_key -N '' -t ed25519
ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa
# ufw enable
# ufw allow ssh
# -m adds home dir / -s fixes the prompt /
sudo useradd -m -s /bin/bash <username>
# give the user root permissions
sudo usermod -aG sudo <username>
# check if user is root - the following should prompt "root"
sudo whoami