瀏覽代碼

ssh over tor

systemd-xsession
父節點
當前提交
35a3971c99
共有 2 個檔案被更改,包括 6 行新增2 行删除
  1. +1
    -0
      defaults/main.yaml
  2. +5
    -2
      templates/ssh.config.j2

+ 1
- 0
defaults/main.yaml 查看文件

@@ -35,6 +35,7 @@ eralitex_applications:
m: "{{eralitex_mail_command}}"
r: arandr

ssh_over_tor: false

eralitex_lock_command: xset s activate
eralitex_enable_screensaver_command: /usr/local/bin/screensaver-enable


+ 5
- 2
templates/ssh.config.j2 查看文件

@@ -1,6 +1,9 @@
{% for hostname in groups.vms %}
{% for hostname in groups.all %}
Host {{hostname}}
{% if 'external_ip' in hostvars[hostname] %}
{% if ssh_over_tor and ('ansible_local' in hostvars[hostname]) and ('tor' in hostvars[hostname].ansible_local) and ('ssh' in hostvars[hostname].ansible_local.tor.tor_hidden_services_hostnames) %}
HostName {{hostvars[hostname].ansible_local.tor.tor_hidden_services_hostnames.ssh}}
ProxyCommand nc -x 127.0.0.1:9050 -X5 %h %p
{% elif 'external_ip' in hostvars[hostname] %}
HostName {{hostvars[hostname].external_ip}}
{% endif %}
{% endfor %}