Table of Contents

Some Commands i Came across the i find useful. Just a placeholder maybe

SUB LINKS:

How to reset password for Web Based Deluge

Interface Priority on Linux

sudo nmcli connection modify 'enter ssid here' ipv4.route-metric 50

sudo nmcli connection up 'enter ssid here'

Install sudo command on Debian 12

su
apt install sudo

then add a user to sudo group

$ su -l
# adduser <your_username_here> sudo
# logout

Change IP Addressing from DHCP to Static

sudo nano /etc/network/interfaces

auto <interface>
iface <interface> inet static
address x.x.x.x
netmask 255.255.255.0
gateway xx.xx.xx
dns-nameservers xx.xx.xx


sudo systemctl restart networking.service

sudo systemctl status networking.service

Change the hostname on Debian 12 11 10 9

hostnamectl set-hostname {name-here}
sudo hostnamectl set-hostname enkielhostsample


nano /etc/hosts and Find all references to oldname and replace with newname

Check DNS (IF RESOLVECTL IS USED)

resolvectl status
resolvectl dns <interface> <dns address>,<dns address>

Remove Folder Contents

sudo rm -rf foldername/*

Missing disk space on new installation

lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv and then resize2fs /dev/ubuntu-vg/ubuntu-lv

Root file system requires manual fsck Error

you should be able to drop to some maintenance shell (if not already opened), where you may run fsck -yf /dev/sda1

Reading package lists... Error!

“Reading package lists… Error!”: This is a general error indicating that apt couldn't successfully read and parse the package lists.

sudo apt clean
sudo rm -rf /var/lib/apt/lists/*
sudo apt update

Setup Mobile Linux/Termux Storage sharing


To share the SD storage of phone/tablet

termux-setup-storage


Kill Zombied Application

ps -eo pid,ppid,state,cmd | awk '$3=="Z" { print "Zombie PID:", $1, "Parent PID:", $2 }'

Once parent ID is shown. Run

Kill -HUP parentID

Allow password auth only for a single IP

# Default: Key-based only for everyone
PasswordAuthentication no
PubkeyAuthentication yes

# Exception: allow password login from specific IP
Match Address 203.0.113.25
    PasswordAuthentication yes
    
    
# Default: Key-based only for everyone
PasswordAuthentication no
PubkeyAuthentication yes

# Exception: allow password login from specific IP
Match Address 203.0.113.25
    PasswordAuthentication yes


---

How this works

PasswordAuthentication no globally disables password login.

The Match Address block overrides that for connections from the specified IP.

SSH evaluates these from top to bottom:

If the connection’s source IP matches, the block settings apply just for that session.




---

Steps to Apply

1. Edit sshd config

sudo nano /etc/ssh/sshd_config

Add the example above at the bottom of the file.


2. Test syntax before reloading:

sudo sshd -t


3. Reload SSH service:

sudo systemctl reload sshd

    

Fix DNS Configuration

Fix /etc/resolv.conf (DNS configuration)
sudo nano /etc/resolv.conf


Make sure it has something like:

nameserver 8.8.8.8
nameserver 1.1.1.1


If it's overwritten on reboot or by systemd-resolved, you can instead:

sudo systemctl disable systemd-resolved
sudo systemctl stop systemd-resolved
sudo rm /etc/resolv.conf
echo -e "nameserver 8.8.8.8\nnameserver 1.1.1.1" | sudo tee /etc/resolv.conf