mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-11 17:47:35 +00:00
Update cheatsheets
This commit is contained in:
@@ -5,21 +5,26 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# cryptsetup
|
||||
|
||||
> Manage plain dm-crypt and LUKS (Linux Unified Key Setup) encrypted volumes.
|
||||
> More information: <https://gitlab.com/cryptsetup/cryptsetup/>.
|
||||
> Manage plain `dm-crypt` and LUKS (Linux Unified Key Setup) encrypted volumes.
|
||||
> Some subcommands such as `luksFormat` have their own usage documentation.
|
||||
> More information: <https://manned.org/cryptsetup>.
|
||||
|
||||
- Initialize a LUKS volume (overwrites all data on the partition):
|
||||
- Initialize a LUKS volume with a passphrase (overwrites all data on the partition):
|
||||
|
||||
`cryptsetup luksFormat {{/dev/sda1}}`
|
||||
`cryptsetup luksFormat {{/dev/sdXY}}`
|
||||
|
||||
- Open a LUKS volume and create a decrypted mapping at `/dev/mapper/target`:
|
||||
- Open a LUKS volume and create a decrypted mapping at `/dev/mapper/mapping_name`:
|
||||
|
||||
`cryptsetup luksOpen {{/dev/sda1}} {{target}}`
|
||||
`cryptsetup open {{/dev/sdXY}} {{mapping_name}}`
|
||||
|
||||
- Display information about a mapping:
|
||||
|
||||
`cryptsetup status {{mapping_name}}`
|
||||
|
||||
- Remove an existing mapping:
|
||||
|
||||
`cryptsetup luksClose {{target}}`
|
||||
`cryptsetup close {{mapping_name}}`
|
||||
|
||||
- Change the LUKS volume's passphrase:
|
||||
- Change a LUKS volume's passphrase:
|
||||
|
||||
`cryptsetup luksChangeKey {{/dev/sda1}}`
|
||||
`cryptsetup luksChangeKey {{/dev/sdXY}}`
|
||||
|
||||
22
tldr/linux/cryptsetup-luksformat
Normal file
22
tldr/linux/cryptsetup-luksformat
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# cryptsetup luksFormat
|
||||
|
||||
> Initialize a LUKS partition and the initial key slot (0) with a passphrase or keyfile.
|
||||
> Note: this operation overwrites all data on the partition.
|
||||
> More information: <https://manned.org/cryptsetup-luksFormat>.
|
||||
|
||||
- Initialize a LUKS volume with a passphrase:
|
||||
|
||||
`cryptsetup luksFormat {{/dev/sdXY}}`
|
||||
|
||||
- Initialize a LUKS volume with a keyfile:
|
||||
|
||||
`crypsetup luksFormat {{/dev/sdXY}} {{path/to/keyfile}}`
|
||||
|
||||
- Initialize a LUKS volume with a passphrase and set its label:
|
||||
|
||||
`cryptsetup luksFormat --label {{label}} {{/dev/sdXY}}`
|
||||
31
tldr/linux/cryptsetup-open
Normal file
31
tldr/linux/cryptsetup-open
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# cryptsetup open
|
||||
|
||||
> Create a decrypted mapping of an encrypted volume.
|
||||
> Note: with TRIM enabled, minimal data leakage in form of freed block information, perhaps sufficient to determine the filesystem in use may occur.
|
||||
> However, you still most likely want to enable it, because the data inside is still safe and SSDs without TRIM will wear out faster.
|
||||
> More information: <https://manned.org/cryptsetup-open>.
|
||||
|
||||
- Open a LUKS volume and create a decrypted mapping at `/dev/mapper/mapping_name`:
|
||||
|
||||
`cryptsetup open {{/dev/sdXY}} {{mapping_name}}`
|
||||
|
||||
- Use a keyfile instead of a passphrase:
|
||||
|
||||
`cryptsetup open --key-file {{path/to/file}} {{/dev/sdXY}} {{mapping_name}}`
|
||||
|
||||
- Allow the use of TRIM on the device:
|
||||
|
||||
`cryptsetup open --allow-discards {{/dev/sdXY}} {{mapping_name}}`
|
||||
|
||||
- Write the `--allow-discards` option into the LUKS header (the option will then always be used when you open the device):
|
||||
|
||||
`cryptsetup open --allow-discards --persistent {{/dev/sdXY}} {{mapping_name}}`
|
||||
|
||||
- Open a LUKS volume and make the decrypted mapping read-only:
|
||||
|
||||
`cryptsetup open --readonly {{/dev/sdXY}} {{mapping_name}}`
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# iwctl
|
||||
|
||||
> Control the `iwd` network supplicant.
|
||||
> More information: <https://iwd.wiki.kernel.org/gettingstarted>.
|
||||
> More information: <https://archive.kernel.org/oldwiki/iwd.wiki.kernel.org/gettingstarted.html>.
|
||||
|
||||
- Start the interactive mode, in this mode you can enter the commands directly, with autocompletion:
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`strace -p {{pid}} -c`
|
||||
|
||||
- Show the [T]ime spent in every system call:
|
||||
- Show the [T]ime spent in every system call and specify the maximum string [s]ize to print:
|
||||
|
||||
`strace -p {{pid}} -T`
|
||||
`strace -p {{pid}} -T -s {{32}}`
|
||||
|
||||
- Start tracing a program by executing it:
|
||||
|
||||
|
||||
25
tldr/linux/upnpc
Normal file
25
tldr/linux/upnpc
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# upnpc
|
||||
|
||||
> Configure port forwarding rules on your router via the UPnP protocol.
|
||||
> More information: <https://manned.org/upnpc>.
|
||||
|
||||
- Forward the external TCP port 80 to port 8080 on a local machine:
|
||||
|
||||
`upnpc -a {{192.168.0.1}} 8080 80 tcp`
|
||||
|
||||
- Delete any port redirection for external TCP port 80:
|
||||
|
||||
`upnpc -d 80 tcp`
|
||||
|
||||
- Get information about UPnP devices on your network:
|
||||
|
||||
`upnpc -s`
|
||||
|
||||
- List existing redirections:
|
||||
|
||||
`upnpc -l`
|
||||
Reference in New Issue
Block a user