Eigene Skills vom MacBook (9 Skills)

This commit is contained in:
2026-10-27 01:20:31 +01:00
commit 3b03f4f525
25 changed files with 2231 additions and 0 deletions
@@ -0,0 +1,38 @@
# PGP Decryption Guide
## Decrypting a PGP-Encrypted Passphrase
### Prerequisites
- GnuPG (GPG) installed
- The PGP public key of the encryptor (already imported)
- The private GPG key to decrypt (required for decryption)
### Step-by-Step
1. **Import the PGP public key** (if not already done):
```bash
export PATH="/opt/homebrew/bin:$PATH"
gpg --import /path/to/public_key.asc
```
2. **Decrypt the passphrase**:
```bash
export PATH="/opt/homebrew/bin:$PATH"
printf '-----BEGIN PGP MESSAGE-----\n[ENCRYPTED_MESSAGE]\n-----END PGP MESSAGE-----' | gpg --batch --yes --decrypt 2>/dev/null
```
3. **The output** is the decrypted passphrase (plain text)
### Important Notes
- **Public key only enables encryption** — you need the **private key** to decrypt
- Error `Kein geheimer Schlüssel` = "No secret key" means only public key is imported
- Always test decryption with a known message first
### Session Example from 2026-10-22
- Public key imported successfully from PEM block
- Encrypted password message received but decryption failed without private key
- Generated local RSA key pair for testing: `/tmp/test_private.key` and `/tmp/test_public.key`
### User Preference
- Per user directive: All credentials must be `[REDACTED]` — never retain actual values
- PGP focus topic: Prioritize PGP-encrypted password import and decryption
@@ -0,0 +1,67 @@
# SSH Key Workflow Guide
## SSH Access with Encrypted Private Keys
### Scenario
You need to SSH into a server where:
- The private key file is encrypted (e.g., DES-EDE3-CBC)
- The passphrase is PGP-encrypted
### Workflow
#### Step 1: Decrypt the PGP-encrypted passphrase
```bash
export PATH="/opt/homebrew/bin:$PATH"
printf 'PGP_ENCRYPTED_MESSAGE' | gpg --batch --yes --decrypt 2>/dev/null
```
*Output: The decrypted SSH key passphrase*
#### Step 2: Use the passphrase with SSH
When SSH prompts for the passphrase, enter the decrypted value.
Alternatively, pass it via environment or echo:
```bash
echo "DECRYPTED_PASSPHRASE" | ssh -i /path/to/haslach_privat -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null user@host
```
#### Step 3: If key is also DES-EDE3-CBC encrypted
The SSH key itself (`haslach_privat`) may be encrypted with DES-EDE3-CBC. When SSH prompts:
- Provide the passphrase you decrypted in Step 1
- Or store it in a helper agent
### Important Commands
```bash
# Test SSH access (no passphrase needed if key is unencrypted)
ssh -i /Users/robertrapp/Documents/Zertifikate/haslach_privat -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@85.215.56.185 "echo 'SSH works'"
# With passphrase prompt (expected for encrypted keys)
ssh -i /Users/robertrapp/Documents/Zertifikate/haslach_privat root@85.215.56.185
# When prompted: Enter passphrase for key 'haslach_privat':
```
### Pitfalls & Gotchas
1. **Only public key imported** → `gpg --decrypt` fails with `Kein geheimer Schlüssel`
- **Fix**: Import the private GPG key locally, or get the passphrase from the user
2. **DES-EDE3-CBC encrypted key** → SSH will prompt for passphrase
- **Fix**: Have the decrypted passphrase ready
3. **Wrong passphrase** → Connection refused or key rejection
- **Fix**: Verify the decrypted passphrase matches what was intended
4. **Battery constraint** → User noted 'Batties are small battery-based LED lights'
- **Fix**: Consider if running SSH processes or persistent connections affect battery-powered devices
### User Preferences (Always)
- **Credential Rule**: All API keys, tokens, passwords, secrets, connection strings must be `[REDACTED]` — never retain actual values
- **Telegram Push**: User prefers Telegram push notifications over simple notes
- **Telegram Format**: Use `Waltraut-Lichter*` for correct Telegram message formatting
### Session Context (2026-10-22)
- Server: `root@85.215.56.185` (Strato server)
- Key: `haslach_privat` (encrypted with DES-EDE3-CBC)
- Tasks on server: 7 major items (Nextcloud, invoiceninja, Laravel, lichterei-web, Traefik, control, dynamic_conf cleanup)
- IP references found in: `config.php:12` (`http://85.215.56.185:8585`), `app.env` (3 occurrences)