用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/krmorehead/vm_builds --skill lan-ssh-patterns命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | lan-ssh-patterns |
| description | SSH ProxyCommand for LAN hosts behind OpenWrt router. Connection hardening, credential safety, keepalives. |
Controller → Primary host (ProxyCommand SSH) → LAN host
Dependency: OpenWrt baseline must be running before LAN hosts reachable.
set -a; source test.env; set +ameta: reset_connection + wait_for_connection pre_tasks to the first Phase 2 play targeting lan_hosts.# inventory/group_vars/lan_hosts.yml
ansible_ssh_common_args: >-
-o ProxyCommand="ssh
-o ServerAliveInterval=15
-o ServerAliveCountMax=4
-o StrictHostKeyChecking=no
-o UserKnownHostsFile=/dev/null
-W %h:%p root@{{ lookup('env', 'PRIMARY_HOST') }}"
-o StrictHostKeyChecking=no
-o UserKnownHostsFile=/dev/null
-o ConnectTimeout=30
-o ServerAliveInterval=15
-o ServerAliveCountMax=4
ProxyCommand (not ProxyJump) is required so we can pass -o ServerAliveInterval
to the jump connection. With ProxyJump, only the outer connection gets keepalives
from the command line — the jump connection inherits from ssh_config only.
[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=300s -o ServerAliveInterval=15 -o ServerAliveCountMax=4
pre_tasks:
- name: Clear stale SSH state to LAN hosts
ansible.builtin.meta: reset_connection
- name: Wait for SSH via ProxyCommand to stabilize
ansible.builtin.wait_for_connection:
timeout: 120
delay: 5
Previous bug: mesh1 became UNREACHABLE mid-play during proxmox_igpu (54 tasks
completed, then "Data could not be sent"). Root cause: the controller→home
ControlMaster that carried the ProxyJump tunnel died silently because:
(a) ControlPersist=60s was too short, (b) no keepalives on the jump connection,
(c) no connection recovery at play boundaries.
# Verify OpenWrt running
qm status 100
# Verify LAN bridge IP
ip -4 addr show | grep 10.10.10
# Ping LAN host from primary
ping -c1 10.10.10.210
# SSH via ProxyJump
ssh -o ProxyJump=root@192.168.86.201 root@10.10.10.210 hostname
ssh -L 8007:<lan-host-ip>:8006 root@192.168.86.201
# Browse https://localhost:8007
Plays targeting lan_hosts MUST come after OpenWrt configure:
NEVER remove credentials in cleanup:
# Only remove playbook artifacts
- name: Remove ansible-managed files
file: path={{ item }} state=absent
loop:
- /etc/network/interfaces.d/ansible-bridges.conf
- /etc/ansible/facts.d/vm_builds.fact
LAN host unreachable:
qm status 100ip -4 addr show | grep 10.10.10ssh root@10.10.10.1 'cat /tmp/dhcp.leases'SSH permission denied:
ssh -o BatchMode=yes root@10.10.10.210 hostname