- FIDO2 (AKA, "security key" / "sk") key:
- You really need physical presence (need to tap the yubikey - no prompts)
- Odd workflow even with ssh-agent for Go due to lack of tap prompt
- Need to update OpenSSH on macOS to at least 8.2 on Big Sur, and servers
- OpenSSH added FIDO2 support recently (8.2, early 2020 - see
ssh -V
)
- PIV (Personal Identity Verification) key:
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
#!/bin/sh | |
# screen_is_locked is based on work by Joel Bruner: | |
# https://stackoverflow.com/a/66723000 | |
# | |
# For an Objective-C implementation, see: | |
# https://stackoverflow.com/a/76241560 | |
# | |
# This version avoids creating temporary files (via '<<<') by using plutil. | |
# |
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
#!/bin/bash | |
# This snippet demonstrates how to send and receive data | |
# encrypted with openssl using netcat. | |
# | |
# You can switch around the netcat listener and sender | |
# depending on your preference. This example is setup | |
# for copying data from a host into a VirtualBox VM. | |
# You can also substitute 'nc' for another tool. | |
# |
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 example code demonstrates how to add a prefix to messages | |
// generated by Go's standard library logger *after* the log flags. | |
// | |
// For example, this source file's main() produces the | |
// following output: | |
// 2020/04/04 11:45:24 main.go:13: [my cool prefix] some work from anonymous go routine | |
// 2020/04/04 11:45:25 main.go:18: [my cool prefix] here is a panic 1 | |
// panic: here is a panic 1 | |
// | |
// goroutine 1 [running]: |
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
package power | |
import ( | |
"errors" | |
"os/exec" | |
"os/user" | |
"runtime" | |
) | |
// Power provides several methods for controlling a machine's power state. |