Skip to content

Instantly share code, notes, and snippets.

@csarn
csarn / README.md
Last active December 4, 2024 03:12
ZFS pull backup with minimal permissions

Usage

on system that should be backed up

  • put "restrict_commands.sh" in /usr/local/bin and make it executable
  • install ts, lzop and optionally mbuffer
useradd zfsbackup --create-home --system
mkdir /home/zfsbackup/.ssh
zfs allow -u zfsbackup send,hold tank/dataset
echo 'restrict,command="restrict_commands.sh" ssh-ed25519 ...' > /home/zfsbackup/.ssh/authorized_keys
@Mikesco3
Mikesco3 / remote_syncoid_as_unprivilleged_user_README.md
Last active March 22, 2022 07:33 — forked from csarn/README.md
ZFS pull backup with minimal permissions

Usage

1. On system that should be backed up

create a user called zfsbackup

useradd zfsbackup --create-home --system
mkdir -p /home/zfsbackup/{.ssh,.local/bin}
chown zfsbackup:zfsbackup /home/zfsbackup --recursive

add a restricted list of commands allowed by this user

@sporkus
sporkus / notes.md
Created November 11, 2022 04:44
Exposing zfs snapshot to windows previous version using samba vfs_shadow_copy2

Exposing zfs snapshot to windows previous version using samba vfs_shadow_copy2

This was much trickier than I had originally anticipated and have spent a few hours testing.

The config from samba wiki absolutely works, but it wasn't ranked higher in search engine and it's not general enough. https://github.com/zfsonlinux/zfs-auto-snapshot/wiki/Samba

Tested on ubuntu 22.04LTS, samba 4.15.9 and windows 11.

TLDR

Proxmox VE tips

Just a somewhat chaotic list of personal Proxmox VE related tips/notes or interesting (to me) things I'm working on or experiment with.
Some of the things you see here are niche or purely experimental. I try to label them as such, but as always with random code snippets, make sure to review anything before running it in your own environment. Perhaps test in a virtual PVE first.

Please note that unless you see a shebang (#!/...) these code blocks are usually meant to be copy & pasted directly into the shell. Some of the steps will not work if you run part of them in a script and copy paste other ones as they rely on variables set before.
The { and } surrounding some scripts are meant to avoid cluttering your shell history with individual commands, etc. You can ignore them if you manually copy paste the individual commands.

Table of contents

Proxmox VE tips

Just some tips I gathered over time. All in one easily reachable place so I can share it wherever I want.

Please note that unless you see a shebang (#!/...) these code blocks are usually meant to be copy & pasted directly into the shell. Some of the steps will not work if you run part of them in a script and copy paste other ones as they rely on variables set before.
The { and } surrounding some scripts are meant to avoid poisoning your bash history with individual commands, etc. You can ignore them if you manually copy paste the individual commands.
I chose to write things "in the open" that way so there's still some control and things don't become a black box.

Table of contents