Skip to content


Linux is an open source operating system. Learn how to navigate the terminal and do some basic tasks.

Add user

 # This will add a user to the following locations: /etc/passwd, /etc/shadow, /etc/group and /etc/gshadow
 # The -m option after useradd, will make a home directory.
 $ sudo useradd -m username
 $ sudo passwd username
 # Add to sudo group
 $ sudo usermod -aG sudo username
 # No sudo password for username
 $ sudo visudo
 # Fix bash shell not showing username and hostname
 $ sudo chsh -s /bin/bash username

Remove a user

 # Make sure user is logged out
 $ sudo pkill -KILL -u username
 $ sudo deluser username
 # Manually remove from sudo no password
 $ sudo visudo
 # Delete and save

Change Hostname

 $ sudo hostnamectl set-hostname "decyphertek"
 $ sudo su -c "echo ' decyphertek' >> /etc/hosts"
 $ hostnamectl
 # Logout


 # Manually Change History
 $ vim ~/.bash_history
 # dd or change / add 
 $ exit
 # log back in
 $ history

System Info

 $ sudo apt install -y neofetch
 $ neofetch

Network Info

 # Get your ip address
 $ sudo apt install net-tools
 $ ifconfig
 # See listening ports 
 $ netstat -tuna

apt-key deprecated

 $ sudo apt-key list
 # Replace 3213339E with the last x4 of the pub. You can rename the .gpg if using trusted.gpg to something relevant. 
 $ sudo apt-key export 3213339E | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/namehere.gpg
 # A quick way is to just move the key
 $ sudo mv /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/trusted.gpg


 # Minimal Xubuntu 22.04 Minimal Desktop install doesnt have Bluetooth software installed.
 # PulseAudio Option 
 $ sudo apt install -y blueman bluez* pulseaudio pulseaudio-module-bluetooth pulseaudio-equalizer xfce4-pulseaudio-plugin ubuntu-restricted-extras linux-firmware firmware-sof-signed
 $ sudo systemctl daemon-reload
 $ sudo systemctl stop bluetooth. service
 $ sudo systemctl unmask bluetooth.service
 $ sudo systemctl start bluetooth.service
 $ sudo systemctl enable bluetooth
 $ sudo systemctl mask bluetooth.service 
 $ sudo rmmod btusb
 $ sudo modprobe btusb
 $ sudo rfkill unblock all
 # Purge Pipewire Conflicts , if any with pulsewire
 $ sudo apt purge -y pipewire* libspa-0.2-bluetooth
 $ sudo apt autoremove
 # reboot system
 $ pactl info
 $ pulseaudio -k
 $ pulseaudio --start

 # PipeWire Option - Xfce desktop bluetooth issues . 
 $ sudo add-apt-repository ppa:pipewire-debian/pipewire-upstream
 $ sudo apt update && sudo apt install -y pipewire libspa-0.2-bluetooth pipewire-audio-client-libraries pulseaudio-module-bluetooth ubuntu-restricted-extras linux-firmware firmware-sof-signed
 $ sudo apt purge pulseaudio*
 # Reboot system
 $ pactl info


 $ sudo apt-get install nfs4-acl-tools acl
 # Read , Write , & Execute access to a single user
 $ sudo setfacl -m u:username:rwx folder/
 # Add recursive permissions 
 $ sudo setfacl -m u:username:rwx -R folder/ 
 # Read , Write , & Execute access to All Users in a group
 $ sudo setfacl -m g:groupname:rwx folder/
 # You can set which permisisons you want the user or group to have.
 $ sudo getfacl folder/
 # Revoke user & group access
 $ sudo setfacl -x u:username,g:groupname folder/

Enable AWS Workspace

 # To enable access for your Linux system, please follow these steps :
 1. AWS Console > WorkSpaces > Directories > Select your directory > Scroll down: Other Platforms > Edit > Select Linux