User Tools

Site Tools


ubuntu_server_setup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
ubuntu_server_setup [2021/02/11 13:50]
mstraub [Greeting]
ubuntu_server_setup [2021/08/26 16:32]
mstraub [Java]
Line 1: Line 1:
 ====== Ubuntu Server Setup ====== ====== Ubuntu Server Setup ======
  
-This document should outline a few steps that are useful after a fresh install of an Ubuntu Server.+This document should outline a few steps that are useful after a fresh install of an Ubuntu Server ​- last updated for 20.04.
  
-===== Basic Packages ​=====+===== Install Useful Tools =====
  
-If you are dealing with a minimal installation (meta-package ubuntu-minimal) you may want to beef it up a bit. Check what packages are typically bundled e.g. when installing Ubuntu Server or just select your server style: +<​code ​bash
-<​code>​ +sudo apt install mlocate htop ncdu ranger tldr tree vim
-tasksel # ncurses GUI +
-tasksel --list-tasks +
-tasksel --task-packages server+
 </​code>​ </​code>​
  
-Some additional packages for easier CLI handling: +===== More Software ===== 
-<​code>​ + 
-sudo apt install bash-completion ubuntu-release-upgrader-core software-properties-common +==== Samba CIFS ==== 
-</code>+ 
 +If you need to mount Windows network drives:
  
-And some more useful tools: 
 <code bash> <code bash>
-sudo apt install ​htop ncdu ranger tldr tree vim+sudo apt install ​cifs-utils
 </​code>​ </​code>​
  
-===== Java =====+==== Java ====
  
 If you are fine with the OpenJDK version that comes with your Ubuntu: If you are fine with the OpenJDK version that comes with your Ubuntu:
Line 66: Line 63:
 ===== Enable Automatic Security Updates ===== ===== Enable Automatic Security Updates =====
  
-Quickly enable ​unattended upgrades:+Install ​unattended-upgrades
 + 
 +<code bash> 
 +sudo apt install unattended-upgrades 
 +</​code>​ 
 + 
 +Or reconfigure it if it's already installed:
 <code bash> <code bash>
 sudo dpkg-reconfigure -plow unattended-upgrades sudo dpkg-reconfigure -plow unattended-upgrades
Line 72: Line 75:
 This creates the file ''/​etc/​apt/​apt.conf.d/​20auto-upgrades''​. This creates the file ''/​etc/​apt/​apt.conf.d/​20auto-upgrades''​.
  
-Then set ''​Unattended-Upgrade::​Remove-Unused-Dependencies''​ to ''​true''​ in ''/​etc/​apt/​apt.conf.d/​50unattended-upgrades''​.+To avoid filling up small hard drives over time (e.g. with multiple kernel versions) it may be useful to activate the equivalent of ''​sudo apt autoremove'':​ 
 + 
 +Set ''​Unattended-Upgrade::​Remove-Unused-Dependencies''​ to ''​true''​ in ''/​etc/​apt/​apt.conf.d/​50unattended-upgrades''​.
  
 See also: See also:
   * ''/​etc/​apt/​apt.conf.d/​20auto-upgrades''​ (and ''​man apt.conf''​)   * ''/​etc/​apt/​apt.conf.d/​20auto-upgrades''​ (and ''​man apt.conf''​)
   * [[https://​help.ubuntu.com/​community/​AutomaticSecurityUpdates]]\\   * [[https://​help.ubuntu.com/​community/​AutomaticSecurityUpdates]]\\
-  * [[https://help.ubuntu.com/16.04/serverguide/automatic-updates.html]]+  * [[https://​ubuntu.com/​server/docs/package-management]]
  
  
Line 111: Line 116:
  
 Don't forget to make the file executable. Don't forget to make the file executable.
 +
 +When using ''​byobu''​ delete ''​~/​.hushlogin''​ to still see the greeting (and all other info you usually get when logging in).
 ===== More Resources ===== ===== More Resources =====
  
-[[http://plusbryan.com/my-first-5-minutes-on-a-server-or-essential-security-for-linux-servers]]\\ +[[https://www.ubuntupit.com/best-linux-hardening-security-tips-a-comprehensive-checklist/]]
-[[https://​www.thefanclub.co.za/​how-to/​how-secure-ubuntu-1204-lts-server-part-1-basics]]+
ubuntu_server_setup.txt · Last modified: 2021/10/18 16:19 by mstraub