Installing and Hardening an Ubuntu Server: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 11: Line 11:
</syntaxhighlight>
</syntaxhighlight>


<code>lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
<syntaxhighlight lang="lvm">
lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
exit
</syntaxhighlight>


exit</code>
And then, we need to resize the file system to use the new available space in the logical volume. After that's done, we should make sure that it shows the new disk size.
 
<syntaxhighlight lang="bash">
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
df -h
</syntaxhighlight>
 
Next, let's get the latest updates for the server and remove any space wasters.
 
<syntaxhighlight lang="bash">
sudo apt update && sudo apt -y upgrade && sudo apt -y autoremove
</syntaxhighlight>


And then, we need to resize the file system to use the new available space in the logical volume. After that's done, we should make sure that it shows the new disk size.
Now we need to configure the timezone and our charset. If you want to enable unattended upgrades, now is a good time to do that as well.


<code>sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
<syntaxhighlight lang="bash">
sudo dpkg-reconfigure tzdata && locale-gen en_US.UTF-8 && dpkg-reconfigure locales && dpkg-reconfigure -plow unattended-upgrades
</syntaxhighlight>


df -h</code>
==Securing the Server==
==Securing the Server==
==Configuring the Firewall==
==Configuring the Firewall==
==Installing Fail2Ban==
==Installing Fail2Ban==
==Securing SSH==
==Securing SSH==
<syntaxhighlight lang="bash">
</syntaxhighlight>