Some setup processes to get Ubuntu 14 or 16 ready to use after initial install
Ubuntu Server download is available from: https://www.ubuntu.com/download/server
NMTUI (Network Manager Text User Interface) is an easy to use GUI which makes it easy to set up your networking. You must have internet access to install it.
-
Install Network Manager
sudo apt install network-manager
-
Enable the Network Managers service for startup and start the service
sudo systemctl enable NetworkManager sudo systemctl start NetworkManager
-
Use
sudo vi /etc/netplan/50-cloud-init.yaml
to make the file look like:
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
renderer: NetworkManager
- Use
sudo vi /etc/NetworkManager/NetworkManager.conf
to make the file look like:
[main]
plugins=ifupdown,keyfile
[keyfile]
unmanaged-devices=*,except:type:ethernet
[ifupdown]
managed=false
[device]
wifi.scan-rand-mac-address=no
-
Restart the server with
sudo shutdown -r now
-
Once back up, run the network manager with
nmtui
-
Edit your network settings and make sure to deactivate/activate the interface if you are on the console. If not on the console, reboot the server to have settings take effect
-
Use
ip addr
to check that your settings took effect
If you didn't setup the network adapters during the initial install (like CentOS does), we have to login (using non-root user) to the KVM and set up the network as the first thing
-
Open the 'interfaces' file for editing
sudo nano /etc/network/interfaces
-
Modify and enter the information below based on the adapters listed already in the file and the IP info you need to assign
auto eth0 iface eth0 inet static address 192.168.1.100 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 8.8.8.8 iface eth0 inet6 static address 2001:db8:1ce:1ce:babe::100/64 gateway 2001:db8:1ce:1ce:babe::1 dns-nameservers 2001:4860:4860::8888 2001:4860:4860::8844
-
Hit CTRL-O and then ENTER to save the file
-
Hit CTRL-X to exit the Nano editor
-
UBUNTU 14: Restart the networking stack to effect changes
sudo ifdown eth0 sudo ifup eth0
-
UBUNTU 16: Restart the networking stack to effect changes
sudo /etc/init.d/networking restart
-
Check that the IP settings took
ip addr
-
Ping something to check connectivity
ping 8.8.8.8
Ubuntu has the root user disabled by default and requires you to log in with a user created during the install process. Sometimes we need to enable the root account
-
Set the password for the root account
sudo passwd root
-
Unlock the root account
sudo passwd -u root
-
UBUNTU 14: Enable SSH login as root user (optional)
sudo sed -i --follow-symlinks 's/PermitRootLogin without-password/PermitRootLogin yes/g' /etc/ssh/sshd_config sudo service ssh restart
-
UBUNTU 16: Enable SSH login as root user (optional)
sudo sed -i --follow-symlinks 's/PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config sudo service ssh restart
You may have selected some level of automatic updates during the install, but it is always a good idea to update your OS with the latest patches when you build it
-
Check repos for available updates
sudo apt update -y
-
Install available updates
sudo apt upgrade -y
These are some packages I install on almost everything
-
UBUNTU 16: Python 2.X is something you will likely need
sudo apt install python-minimal -y
-
Open VM Tools is an open version of the VMWare Tools app. Useful if on a hypervisor
sudo apt install open-vm-tools -y
-
A GIT client is a necessity if using a GIT repo
sudo apt install git -y
We can use SSHFS to connect to another Linux box file system
-
Install the SSHFS package
sudo apt install sshfs -y
-
Mount the local /mnt/ directory to a remote Linux machine
sshfs [email protected]:/root /mnt