Basic Server Setup
Standard procedure for setting up a new Debian/Ubuntu server in this environment.
1. Initial Update
Always start by updating the package lists and upgrading existing packages.
sudo apt update
sudo apt upgrade -y
2. Install Common Tools
Install utilities frequently used for maintenance and monitoring.
sudo apt install -y curl wget git tmux btop iftop net-tools unzip
3. Secure SSH Access
Security best practice: Disable password authentication and root login.
-
Create
.sshdirectory (if not exists):mkdir -p ~/.ssh
chmod 700 ~/.ssh -
Add Authorized Key: Paste your public key into
~/.ssh/authorized_keys.nano ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys -
Configure SSH Daemon: Edit
/etc/ssh/sshd_config:sudo nano /etc/ssh/sshd_configEnsure these settings are set:
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes -
Restart SSH:
sudo systemctl restart sshd
4. Set Hostname
sudo hostnamectl set-hostname <new-hostname>