- The purpose of this machine is as follows:
- Provide control of the working hardware including a SDD "root" drive for small but fast applications.
- Provide control of a slower but much larger SATA array for long-term storage or file sharing among the clients of the network.
- Provide the hypervisor control over LXC and VM machines.
- Provide receipt for email from the local domain hosts and internal receipt, then send the mail to a private gmail account for notice. It must reside on PVE should attached VMs run into trouble, particularly if the mailserver were on a separate host.
- Does not provide file services managed by a "fileserver" LTK appliance.
- Does not provide user, host or client identity services such as DNS or Certificate authority such as Let's Encrypt.
- Don't do anything or make changes if not explicitly required by the overall goal.
- Proxmox backups on PVE explicitly DO NOT include PVE. This prevents an "Ouroboros" condition where I make backups of backups, like a snake eating its own tail.
- By careful effort, the "backup" of the PVE amounts to the install .ISO on a thumb drive, these notes, and a regular copy of /etc/pve. That is a significant factor in my "don't do anything" policy.
- Remove any drives other than the boot drive to ensure the install only pertains to the boot and root filesystem. Note: It is quite possible to create a ZFS "drive" that spans both the SSD and the SATA Array as a single drive. You do not want that.
- By having the drive install to zfs as root, you will be able to use zfs datasets to set quotas for other uses.
- On power down to reboot, attach the SATA array, remove the USB ISO Boot Installer, allow the machine to fully boot to the new PVE OS.
- Follow site policy1.
In this particular case, there is only one user of the SOHO network. Replace the 'root' user accordingly. Otherwise the following instructions are to secure the PVE host for access only by user 'root' and only within the LAN, dropping all other network traffic. - Lock down the server with the firewall2.
This is through the PVE Web, Datacenter/pve:firewall/options, select "Firewall" on the right-side panel and the "edit" button above that. Select the "Firewall" checkbox on the pop-up and "ok" if the firewall is not already activated. - Lock down SSH for "admin" access only.
You should always be able to use the
>_ Shell
button for the PVE host if it is online, but as an alternate especially for SCP/SFTP, we will lock down root access for "keys only." Using the>_ Shell
option, edit/etc/pve/priv/authorized_keys
with SSH keys permitted to access the host root. If there is a key already there, PVE seems to put a fresh new key if one does not exist for it to function. Removing that key is futile. - Edit
/etc/ssh/sshd_config
to replace#PasswordAuthentication yes
withPasswordAuthentication no
. systemctl restart ssh
to reload the new configuration.- The server will require updates, so follow this next howto. There are both CLI and GUI instructions, choose which you find most comfortable.
- If you prefer CLI, you should already know to do
apt update && apt upgrade
. Otherwise, there is aUpdates
button just above theRepositories
section you were just working in. TheRefresh
button is functionally the same as theapt update
command from CLI, and it will show a list of packages to be updated. If you select the>_ Upgrade
button, all will be upgraded. Otherwise, select the specific packages you wish to upgrade and do the same to upgrade only that specific packages. It is wise to periodically check this for package updates. It is also wise to reboot the PVE host at this point to be sure you are running the updated software from this point forward. - From "Datacenter/PVE:Disks/ZFS use the
Create: ZFS
button, select all the unused drives in the array, give it the commonly used name "tank-zfs" with aRAID Level: RAIDZ
, then selectCreate
. This will create and mount a zfs pool with the name/tank-zfs
. Note: While/tank-zfs
can be used to store data, it is most appropriate to use the PVE "Storage" containers and have datasets to manage options such as compression and storage. - In "Datacenter:Storage" you will see a new storage named
tank
. Go ahead and delete that. It may be used for block device storage, but we havelocal-zfs
for that purpose and we want to avoid using the SATA array. Instead, we will use cli to create zfs datasets as we need them. Zfs dataset creation is not implimented in the PVE GUI, but the cli process is simple for what we intend. Drop into CLI using SSH or the>_ Shell
button on the PVE screen. zfs create -p tank/vz
will create a dataset with the defaults and no quota, but options can be set on the dataset later. Note: Those options (such as compression changes) may not take effect except on new files added.- On
Datacenter:Storage
use theAdd
button and selectDirectory
. Give it an ID of "tank" and the directory istank/vz
. TheShared:
box should be off, as there are no additional nodes in this setup. Select theContent:
button and addVZDump backup file
,Container template
, andISO image
. This is where "whole-machine" backups, LXC Container templates, and bootable ISO images will go. - We want to turn OFF those options from "local", select it and use "Edit" and deactivate those selections in
Content:
, and make sure "Snippets" is active. If "Snippets" come into use, they will be small, benefit from the faster drive, and you can't save the options unless one of those is selected anyway. - PVE must be able to receive "localdomain" only email and route that outbound to a private GMail account so warnings
from any PVE host (or the Mac-Mini) can send a notice that can be received remotely. This
howto
explains this in detail.
- On /etc/postfix/main.cf, be sure to edit
mynetworks = 127.0.0.0/8
to include ipv4 for your local network (i.e. 192.168.1.5/24) on both IPv4 and IPv6 (in brackets, of course... i.e. [fe80::5a47:caff:fe74:8c3c]/64). Datacenter/pve:firewall
will allow you toadd
a new rule to the firewall. Use this howto for reference to open up port 25 (SMTP), and bind "Source:" to the local network to deny external use of the router should security fail somewhere, such as the router firewall becoming misconfigured. Note: There is an issue with setting the IPv6 firewall rule.- Rebooting the machine and then using "telnet 25" to attempt to connect from a host on the local net would be a useful test. Note: At this time, mail notifications still need to be better understood and worked on.
- On /etc/postfix/main.cf, be sure to edit
- This optional step howto explains how to set up automatic updates on the PVE host, although if one chooses to do this manually, one should make it a point to schedule and do update for security of the PVE host!
Footnotes
-
On the decision to create a non-root user, there is a howto page with instructions. In an environmment where there are multiple users with levels of access to the PVE host, it will be critical to establish, document, and follow an appropriate policy. In this particular use case, there is only one user with full access. To simplify the install process, user 'root' is presumed. ↩
-
The PVE Firewall has hard-coded exceptions: "WebGUI(8006) and ssh(22) from your local network." ↩