Ubuntu 18.04

Hostname

Set hostname:

hostnamectl set-hostname myhostname

Furthermore you have to edit

/etc/cloud/cloud.cfg

from

preserve_hostname: false

to

preserve_hostname: true

Network

You have to edit

/etc/netplan/*.yaml

Example:

01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
 version: 2
 renderer: networkd
 ethernets:
   enp0s3:
     dhcp4: no
     dhcp6: no
     addresses: [192.168.178.10/24]
     gateway4: 192.168.178.1
     nameservers:
       addresses: [192.168.1.1,8.8.8.8,8.8.4.4]
sudo netplan apply                                   #apply config
sudo netplan --debug apply                           #in case you run into some problems

Firewall

systemctl status ufw.service

Proxy

System wide proxy:

sudo vi /etc/environment
http_proxy="http://my.proxyserver.net:8080/"
https_proxy="http://my.proxyserver.net:8080/"
ftp_proxy="http://my.proxyserver.net:8080/"
no_proxy="localhost,127.0.0.1,::1"
http_proxy="http://<username>:<password>@<hostname>:<port>/"
https_proxy="http://<username>:<password>@<hostname>:<port>/"
ftp_proxy="http://<username>:<password>@<hostname>:<port>/"
no_proxy="<pattern>,<pattern>"

Just for apt/ apt-get:

vi /etc/apt/apt.conf
Acquire::http::Proxy "http://PROXY_FQDN_or_IP:8080";
Acquire::https::Proxy "https://PROXY_FQDN_or_IP:8080";
Acquire::ftp::proxy "ftp://PROXY_FQDN_or_IP:8080";

System Time

timedatectl status
systemctl status systemd-timesyncd.service
/etc/systemd/timesyncd.conf
apt install chrony
/etc/chrony/chrony.conf
systemctl status chrony.service
systemctl restart chrony.service
systemctl is-enabled chrony.service
chronyc sourcestats
chronyc tracking

/etc/chrony/chrony.conf:

pool 0.ubuntu.pool.ntp.org iburst
pool 1.ubuntu.pool.ntp.org iburst
pool 2.ubuntu.pool.ntp.org iburst

Misc

# echo "alias ll='ls -l'" >> /etc/bash.bashrc

Make sure that this file is executed whenever an user enters a shell by adding the following in ~/.bashrc:

# Source global definitions
if [ -f /etc/bash.bashrc ]; then
    . /etc/bash.bashrc
fi

sudoers

admin      ALL = NOPASSWD: ALL
linux/ubuntu/ubuntu18.txt · Last modified: 2020/01/21 17:07 by tmade
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki