Skip to content

Linux

Rights et ownership

Arguments

  • u User
  • g Group
  • o Others
  • a All
  • + Add
  • - Remove
  • = Assignment
  • R Read
  • W Write
  • X Execute
  • D Directory

View rights, ownership and hidden files

Bash
ls -la

Change rights

Bash
chmod +<letter>

Change ownership

Bash
chown <user>:<group> file
# Recursive version for folders
chown -R <user>:<group> folder

Date

Configure local time

Bash
dpkg-reconfigure tzdata

Network

Linux have an hosts file /etc/hosts

Find open ports on a machine

Bash
netstat -lnup
# Variant version with automatique refresh for live monitoring purpose
watch netstat -lnup

Certificates

Import root certificate on linux

Bash
# Create customs certificates folder
sudo mkdir /usr/local/share/ca-certificates/extra
# Copy cert to the folder
sudo cp root.cert.pem /usr/local/share/ca-certificates/extra/root.cert.crt
# Import linux CA
sudo update-ca-certificates
Bash
# Convert CRT to PEM
openssl x509 -in gdroot-g2.crt -out gdroot-g2.pem -outform PEM
# Copy cert to the folder
sudo mv gdroot-g2.pem /etc/pki/ca-trust/source/anchors/
# Import linux CA
sudo update-ca-trust

Others

Usefull website to find package from many linux distros

Sources