-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Karl
committed
Sep 27, 2024
1 parent
e753e09
commit 759484e
Showing
11 changed files
with
250 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,229 @@ | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<meta name="generator" content="Zim 0.75.2"> | ||
<meta name="description" content="Personal website for my programming, computing and finance hobbies"> | ||
<meta name="keywords" content="karl, hunter, go, programming, computing, finance, personal, hobby, defiant-fg, defiant"> | ||
<meta name="Zim template" content="HGE Bootstrap responsive template" /> | ||
<meta name="template author" content="Hugo Gaibor E."> | ||
<meta name="Author" content="Karl Hunter"> | ||
<link rel="icon" href="../../../_resources/images/favicon.ico"> | ||
|
||
<title>Saturday 28 Sep 2024</title> | ||
|
||
<!-- JS Jquery and Bootstrap scripts --> | ||
<script type='text/javascript' src="https://karlhunter.co.uk/res/js/jquery-3.6.0.min.js" type="text/javascript"></script> | ||
<script src="https://karlhunter.co.uk/res/js/bootstrap.min.js"></script> | ||
|
||
<!-- Bootstrap core CSS --> | ||
<link href="https://karlhunter.co.uk/res/css/bootstrap.css" rel="stylesheet" /> | ||
|
||
<!-- highlight module | ||
Syntax highlinting libraries | ||
Taken from https://highlightjs.org/ | ||
https://github.com/highlightjs/highlight.js | ||
You can change higlight code box style by choosing a different css style below, | ||
all styles were included for ease of customization | ||
--> | ||
<link rel="stylesheet" href="https://karlhunter.co.uk/res/highlight/styles/base16/github.min.css"> | ||
<script src="https://karlhunter.co.uk/res/highlight/highlight.min.js"></script> | ||
|
||
<!-- HGE styles and JS functions for this template --> | ||
<link href="https://karlhunter.co.uk/res/css/hge-bootstrap_common.css" rel="stylesheet"> | ||
<script src="https://karlhunter.co.uk/res/js/hge-bootstrap_common.js"></script> | ||
<script src="https://karlhunter.co.uk/res/js/hge-bootstrap_multi-page.js"></script> | ||
</head> | ||
|
||
<body> | ||
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-1 justify-content upper-nav-bar"> | ||
<div class="btn-toolbar" role="toolbar" aria-label="Button groups"> | ||
<div class="btn-group mr-2" role="group" aria-label="First group"> | ||
<span class="text-white"> | ||
<img id="toggleSideMenu" class="pt-0 p-0 px-0 btn" src="https://karlhunter.co.uk/res/images/menu.svg" height="22" alt="Menu"> | ||
</span> | ||
</div> | ||
</div> | ||
<div class="btn-toolbar" role="toolbar" aria-label="Button groups"> | ||
<div class="btn-group mr-2" role="group" aria-label="Navigation group"> | ||
<button type="button" class="btn btn-info btn-xs" role="button" onclick="location.href='./16.html'">Prev</button> | ||
|
||
<button type="button" class="btn btn-info btn-xs" role="button" onclick="location.href='../../../map.html'">Index</button> | ||
|
||
<button type="button" class="btn btn-info btn-xs" role="button" onclick="location.href='../../Index.html'">Next</button> | ||
</div> | ||
</div> | ||
<div> | ||
<div class="btn-group mr-2" role="group" aria-label="Fifth group"> | ||
<button class="btn btn-warning btn-xs" id="scrollUp" onclick="scrollToTop();" style="display: none;"><span style="font-weight: 500;">Scroll Up</span></button> | ||
</div> | ||
<div class="btn-group mr-2" role="group" aria-label="Fifth group"> | ||
<button class="btn btn-success btn-xs pt-0 p-0 px-0" id="printMe" > | ||
<img id="printImg" class="pt-0 p-0 px-1" style="padding:2px;" onclick="window.print();" src="https://karlhunter.co.uk/res/images/printer.svg" alt="Print"> | ||
</button> | ||
</div> | ||
</div> | ||
</nav> | ||
|
||
<div class="container-fluid"> | ||
<div class="row"> | ||
<nav class="col-md-3 col-lg-2 d-md-block bg-light sidebar d-print-none" id="sidebarMenuNav" style="padding-top: 40px;"> | ||
<div id="sidebarMenu"> | ||
<ul> | ||
<li><a href="../../../About.html" title="About" class="page">About</a></li> | ||
<li><a href="../../../Buy_Me_Coffee.html" title="Buy Me Coffee" class="page">Buy Me Coffee</a></li> | ||
<li><a href="../../../Computing.html" title="Computing" class="page">Computing</a></li> | ||
<li><a href="../../../Contact.html" title="Contact" class="page">Contact</a></li> | ||
<li><a href="../../../index.html" title="index" class="page">index</a></li> | ||
<li><a href="../../../Journal.html" title="Journal" class="page">Journal</a> | ||
<ul> | ||
<li><a href="../../2022.html" title="2022" class="page">2022</a></li> | ||
<li><a href="../../2023.html" title="2023" class="page">2023</a></li> | ||
<li><a href="../../2024.html" title="2024" class="page">2024</a> | ||
<ul> | ||
<li><a href="../01.html" title="01" class="page">01</a></li> | ||
<li><a href="../02.html" title="02" class="page">02</a></li> | ||
<li><a href="../03.html" title="03" class="page">03</a></li> | ||
<li><a href="../04.html" title="04" class="page">04</a></li> | ||
<li><a href="../05.html" title="05" class="page">05</a></li> | ||
<li><a href="../07.html" title="07" class="page">07</a></li> | ||
<li><a href="../09.html" title="09" class="page">09</a> | ||
<ul> | ||
<li><a href="./16.html" title="16" class="page">16</a></li> | ||
<li><b>28</b></li> | ||
</ul></li> | ||
</ul></li> | ||
<li><a href="../../Index.html" title="Index" class="page">Index</a></li> | ||
</ul></li> | ||
<li><a href="../../../Money.html" title="Money" class="page">Money</a></li> | ||
<li><a href="../../../Projects.html" title="Projects" class="page">Projects</a></li> | ||
</ul> | ||
|
||
</div> | ||
</nav> | ||
|
||
<main role="main" class="col-md-9 col-lg-10 ml-sm-auto pt-3 px-4" id="pageContents"> | ||
<noscript> | ||
<div style="padding: 10px"> | ||
<span style="color:#D48D8D"> | ||
<p>Javascript is not enabled</p> | ||
<p>Most features won't</p> | ||
<p>work correctly</p> | ||
<p>Please enable javascript</p></span> | ||
</div> | ||
</noscript> | ||
|
||
<h1>Saturday 28 Sep 2024<a name='Saturday 28 Sep 2024_1_1' class="offset-anchor"></a></h1> | ||
|
||
<hr> | ||
|
||
|
||
<h2>Unlock ZFS with a key file<a name='Unlock ZFS with a key file_1_2' class="offset-anchor"></a></h2> | ||
<p> | ||
Instead of typing a passphrase every time you mount your pool, why not try a key file. After you specify the location of the key file, during the mount of the zfs datasets, this location is queried for the key. You could store they key file on a USB drive or on a remote location (such as network share). | ||
</p> | ||
|
||
<p> | ||
<tt>zfs change-key -l -o keylocation=</tt><a href="file:///mnt/network_share/zfs.key" title="file:///mnt/network_share/zfs.key" class="file"><tt>file:///mnt/network_share/zfs.key</tt></a> <tt>-o keyformat=[passphrase | hex | raw] name_pool/dataset_name</tt> | ||
</p> | ||
|
||
<p> | ||
<tt>-l Load key</tt><br> | ||
<tt>-o options</tt> | ||
</p> | ||
|
||
<p> | ||
For example (using raw mode on a dataset called pictures on a pool named, pool) | ||
</p> | ||
|
||
<p> | ||
<tt>zfs change-key -l -o keylocation=</tt><a href="file:///mnt/network_share/zfs.key" title="file:///mnt/network_share/zfs.key" class="file"><tt>file:///mnt/network_share/zfs.key</tt></a> <tt>-o keyformat=raw pool/pictures</tt> | ||
</p> | ||
|
||
<p> | ||
key formats | ||
</p> | ||
<ul> | ||
<li>hex</li> | ||
<li>passphrase</li> | ||
<li>raw</li> | ||
</ul> | ||
|
||
<p> | ||
Let's generate a key file. You can use <tt>openssl</tt> or <tt>urandom</tt> to achieve this. | ||
</p> | ||
|
||
<p> | ||
I used a raw file as my key, but you can specify a passphrase instead. That way, you can manually mount if you know the key. That being said, if you backup the raw file you should be able to access. You must backup the key file - for without this you cannot mount (unless you know the password). | ||
</p> | ||
|
||
<p> | ||
<tt>openssl rand -out</tt> <a href="file:///path/to/keyfile/zfs.key" title="/path/to/keyfile/zfs.key" class="file"><tt>/path/to/keyfile/zfs.key</tt></a> <tt>32</tt> | ||
</p> | ||
|
||
<ul> | ||
<li><tt>rand</tt> (randomisation tool)</li> | ||
<li><tt>-out</tt> (path to the output file)</li> | ||
<li><tt>32</tt> (32-bit key - ZFS supports up to 32 bits)</li> | ||
</ul> | ||
|
||
<p> | ||
or | ||
</p> | ||
|
||
<p> | ||
<tt>dd if=/dev/urandom of=</tt><a href="file:///path/to/keyfile/zfs.key" title="/path/to/keyfile/zfs.key" class="file"><tt>/path/to/keyfile/zfs.key</tt></a> <tt>bs=32 count=1</tt> | ||
</p> | ||
|
||
<ul> | ||
<li><tt>bs</tt> (choose 32 for a 32-bit key - ZFS supports up to 32 bits)</li> | ||
<li><tt>count</tt> (create 1 line)</li> | ||
<li><tt>if</tt> (random device)</li> | ||
<li><tt>of</tt> (path to the output file)</li> | ||
</ul> | ||
|
||
<p> | ||
That's it. The key file will look like this: | ||
</p> | ||
|
||
<p> | ||
<img src="./28/pasted_image.png"> | ||
</p> | ||
|
||
<p> | ||
This is OKAY, but if you want it in a human-readable format, consider using the passphrase or the hex option. | ||
</p> | ||
|
||
<p> | ||
<tt>openssl rand -hex -out</tt> <a href="file:///path/to/keyfile/zfs.key" title="/path/to/keyfile/zfs.key" class="file"><tt>/path/to/keyfile/zfs.key</tt></a> <tt>32</tt> | ||
</p> | ||
|
||
<p> | ||
<img src="./28/pasted_image001.png"> | ||
</p> | ||
|
||
|
||
|
||
|
||
<span class="backlinks"> | ||
<hr class='footnotes'> | ||
<b>Backlinks:</b> | ||
<br /> | ||
<a href='../../../index.html'>index</a> | ||
|
||
<br /> | ||
<a href='../../Index.html'>Journal:Index</a> | ||
|
||
<br /> | ||
<a href='../09.html'>Journal:2024:09</a> | ||
|
||
</span> | ||
|
||
|
||
|
||
</main> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters