Setting up a Debian server
SSH configuration
Login on you server as root and create a new user (change the username to your preferences).
adduser myuser
su myuser
On your local computer generate a new key for SSH.
ssh-keygen -t rsa -b 4096 -C "comment"
Then copy the created key on the server using ssh-copy-id
utilitary
ssh-copy-id -i /path/to/key
on server cat .ssh/authorized_keys to test
Edit the file /etc/ssh/sshd_config
and do the following modifications:
- Uncomment
Port
and set to whatever you want - Uncomment
authorizedKeysFiles
- Set the line
PasswordAuthentication no
- Uncomment
PermitRootLogin no
- Add the line
AllowUsers myuser
Then restart the ssh daemon with systemctl restart sshd
.
Don't forget to update your packages.
apt-get update
apt-get upgrade
Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sh ./get-docker.sh
Docker compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
echo alias dc='docker-compose' >> /root/.bashrc