Nethence Newdoc Olddoc Lab Your IP BBDock  

Setting up Ubuntu Server

Post-installation

Put your SSH keys in place so you can connect as wheeled user and possibly as root. Tweak the SSH daemon,

groupadd -g 11 wheel
usermod -a -G wheel root
usermod -a -G wheel WHEELED_USER
cd /etc/ssh/
cp sshd_config sshd_config.dist

vi sshd_config
allowgroups wheel

service ssh restart

Fix the system short hostname, FQDN and domain search,

vi /etc/hostname (short name is fine)
hostname HOSTNAME (idem)
vi /etc/hosts (long name + short name)

cp -pi /etc/network/interfaces /etc/network/interfaces.dist
vi /etc/network/interfaces

    dns-search EXAMPLE.local EXAMPLE2.local

    #cd /etc/network/interfaces.d/
    #cp 50-cloud-init.cfg 50-cloud-init.cfg.dist
    #vi 50-cloud-init.cfg

    service networking restart
    #service resolvconf restart
cat /etc/resolv.conf

Check that the locale is UTF-8,

echo $LANG
#locale-gen
dpkg-reconfigure locales

Update/upgrade the system,

apt update
apt install apt-utils
apt full-upgrade
apt autoremove
dpkg -l | grep ^rc | awk '{print $2}' | xargs dpkg --purge
do-release-upgrade
apt full-upgrade

Fix the time,

service ntp stop
ntpdate NTP_SERVER
hwclock --systohc
apt install ntp
cp -pi /etc/ntp.conf /etc/ntp.conf.dist
vi /etc/ntp.conf

server NTP_SERVER
#pool...

service ntp start
ntpq -p

Install a few more packages,

#only on Docker host
apt install \
    screen \
            xfsprogs \
            xfsdump

#shared with Dockerfile for containers
apt install \
    apt-transport-https \
    curl \
    dnsutils \
    dos2unix \
    iputils-ping \
    ksh \
    less \
    lftp \
    lsb-release \
    lynx \
    man-db \
    mc \
    mlocate \
    net-tools \
    netcat \
    nmap \
    pwgen \
    software-properties-common \
    sudo \
    telnet \
    unzip \
    vim-nox \
    wget
    #inetutils-ping
apt install \
        postfix bsd-mailx rsyslog

Tweak your environment

Setup GNU/Screen

Eventually install Docker

Eventually run an Apache or NGINX reverse-proxy.


Home | GitHub | Donate