-
- Automatically Check for Updates
- Update Software
- Find Directory Containing Files of Type
- Delete Individual Files of Type
- Delete All Files of Type From a Directory
- Remove Unwanted Software
📃 Currently, not every action that we need to perform in Ubuntu is documented using terminal commands (GUI is used instead). If you discover a command alternative please take note of it so it can be added to the documentation.
📃 Make sure to replace anything wrapped in
<these angle brackets>
with what you need. Ex.<username>
change tolinda
.
📃 Any time you use
sudo
you will be prompted for a password. Your password can be found in the README. Remember, Linux doesn't show passwords as you type them! If you are not prompted with a password refer to Fix Disabled sudo Authentication in Locking Down.
-
- In the terminal, run:
sudo adduser <username>
- In the terminal, run:
-
It is recommended to back up the user's files before deletion
- In the terminal, run:
sudo deluser --remove-home <username>
- In the terminal, run:
-
- In the terminal, run:
sudo mkdir /oldusers-data
- In the terminal, run:
sudo chown root:root /oldusers-data
- In the terminal, run:
sudo chmod 0700 /oldusers-data
- In the terminal, run:
sudo deluser -remove-home -backup-to /oldusers-data
- In the terminal, run:
-
- In the terminal, run:
sudo usermod -L <username>
- In the terminal, run:
-
- In the terminal, run:
sudo usermod –aG sudo <username>
- In the terminal, run:
-
- In the terminal, run:
sudo deluser <username> sudo
- In the terminal, run:
-
- In the terminal, run:
sudo passwd <username>
- Follow the prompts
- In the terminal, run:
📃 Remember, Linux does not display passwords as you type them.
-
- In the terminal, run:
sudo gpasswd –a <username> <group-name>
- In the terminal, run:
-
- In the terminal, run:
sudo nano /etc/pam.d/common-password
- In the file, look for the line that contains
password requisite
- Replace that line with
password requisite pam_cracklib.so retry=3 minlen=10 difok=3 ucredit=-1 lcredit=-1 dcredit=-1 ocredit=-1
- Press CRTL + X to save and exit
- In the terminal, run:
-
- In the terminal, run:
sudo nano /etc/login.defs
- Look for the lines
PASS_MAX_DAYS
,PASS_MIN_DAYS
, andPASS_WARN_AGE
- Edit the values to be something like the following:
PASS_MAX_DAYS 99999
,PASS_MIN_DAYS 1
, andPASS_WARN_AGE 7
📃 The number of days here is somewhat arbitrary - at least for the competition, however as a general practice
PASS_MIN_DAYS
should be set to some number greater than zero. This prevents users from cycling through new passwords to circumvent the restricition of reusing a previous password.- Press CRTL + X to save and exit
- In the terminal, run:
-
- In the terminal, run:
sudo nano /etc/pam.d/common-password
- Look for the line that contains
password required
- Replace the end of the line with
pam_unix.so remember=5
- In the terminal, run:
-
- In the terminal, run:
sudo ufw status
💡 You can use this to verify whether ufw is installed, based on if the command is recognized.
- In the terminal, run:
-
- In the terminal, run:
sudo ufw enable
- In the terminal, run:
-
- In the terminal, run:
sudo ufw allow ssh
📃 Only do this if ssh is a critical service in the specifications and that it is written explicity that you should allow ssh through ufw.
- In the terminal, run:
-
- In the terminal, run:
systemctl list-units --type=service --state=active
💡 You can use this to search for any suspect services or services you thought you turned off.
- In the terminal, run:
-
- In the terminal, run:
sudo systemctl stop <service-name>
- In the terminal, run:
-
- In the terminal, run:
sudo systemctl start <service-name>
- In the terminal, run:
-
- In the terminal, run:
sudo systemctl restart <service-name>
- In the terminal, run:
-
- In the terminal, run:
sudo systemctl disable <service-name>
- In the terminal, run:
-
💡 If you've been running sudo commands, but you aren't being prompted for a password, sudo authentication is probably disabled. 😃
- In the terminal, run:
sudo nano /etc/sudoers
- Search for the line
Defaults !authenticate
- Remove the
!
- Press CRTL + X to save and exit
- In the terminal, run:
-
- In the terminal, run:
sudo nano /etc/ssh/sshd_config
- Look for
PermitRootLogin
- Change
yes
tono
- Press CRTL + X to save and exit
- In the terminal, run:
-
- In the terminal, run:
sudo nano /etc/sysctl.conf
- Change the line
net.ipv4.ip_forward=1
tonet.ipv4.ip_forward=0
- Press CRTL + X to save and exit
❓ Enabling port forwarding basically makes the device act as a router. Unless we absolutely need it, keeping port forwarding enabled just means the device is more vulnerable as any packets or data could be passed into it.
- In the terminal, run:
-
- In the terminal, run:
sudo chmod 0640 /etc/shadow
❓
/etc/shadow
is a file that contains information about each user's password, and is used for authentication purposes. Normally, the file should have 640 permissions, which means the owner (which is root) can read, write, but not execute, the group (administrators) can read, can't write nor execute, and everyone else can't read, write nor execute. Allowing anyone with less authority to have full access to this file presents a security risk as it would be extremely easy to gather hashed passwords. - In the terminal, run:
-
📃 Currently missing our own documentation, for now visit this website.
❓ Having remote desktop enabled for no real reason presents a security risk in that unauthorized people can control the device, mostly if a user is signed in and has the remote desktop service running unknowingly (or knowingly with malicious intent).
-
- Open "Software and Updates"
- Navigate to the "Updates" tab
- Select the dropdown menu next to "Automatically check for updates" and select daily
- Enter the password for your user account, if prompted
- Press "Authenticate"
-
- In the terminal, run:
sudo apt update
- In the terminal, run:
-
- In the terminal, run:
locate *<file-extenstion>
, for example:locate *.mp3
- In the terminal, run:
-
- In the terminal, run:
sudo find . -type f -name "*<file-extension>" -exec rm -i {} \;
- You will be prompted to delete each file that is found, type
y
to delete orn
to keep it
- In the terminal, run:
-
- In the terminal, run:
sudo rm /home/<directory>/*.mp3
- In the terminal, run:
-
- In the terminal, run:
sudo apt remove <package-name>
- In the terminal, run:
sudo apt autoremove
- In the terminal, run: