Benutzer-Werkzeuge

Webseiten-Werkzeuge


contabo:setup

Dies ist eine alte Version des Dokuments!


Contabo server setup

Just after setup of Ubuntu 20.04 server at Contabo there are several things to do.

Preparation

For the first two steps you need to login as root via ssh. All subsequent steps should be done as you new sudo user that you create in step two. However, suggestion is to open two terminals/sessions as root user to the server and only work in one of the terminals for the first three steps (IPv6, SUDO and SSHD setup) and have the other one available if something does not work. After the third step is verified, you can close the second terminal/session.

Enable IP v6

This is a specific thing with contabo: Per default, IPv6 is NOT enabled, and should be done manually. Luckily, there is a command available to do it, but this is just made available via an alias definition in the root's '.bashrc':

alias enable_ipv6='sed -i "/net.ipv6.conf.all.disable_ipv6.*/d" /etc/sysctl.conf && sysctl -q -p && echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6 && sed -i "s/#//" /etc/netplan/01-netcfg.yaml && netplan generate && netplan apply'

So to perform this step, login as root and call

enable_ipv6

Done.

Set up SUDO

Login into server as root, add a user, make her part of sudo group

adduser jrathert
adduser jrathert sudo

Log out and in with ssh as the new user and try if sudo works (by updating the apt database)

sudo apt update

If everything worked, disable the root account (by deleting and locking it, see man passwd).

:!: Attention: You can not login as root or su to it after this step. So please make sure that your new sudo user setup and ssh really work!

sudo passwd -dl root

Set up SSH

Make sure ssh daemon listens on different port and does not allow root login:

  • Set Port 3141
  • Set PermitRootLogin no # or comment our yes
sudo nano /etc/ssh/sshd_config  # do changes above
sudo systemctl restart sshd

Now use different terminal to check if login works with new port

ssh -p 3141 jrathert@<server>  

If everything works, you can and should close all other (root) terminals / sessions to the server now

Update Ubuntu

sudo apt update && sudo apt upgrade

Set up other applications/servers

  1. Reconfigure ssh daemon (port)
  2. Set up relevant servers: Apache, MariaDB, Exim - see separate documents

asd

contabo/setup.1635769773.txt.gz · Zuletzt geändert: 2021/11/01 13:29 von jodoc