From a32a9432f773f42299fe3a287e2496714cb7fc82 Mon Sep 17 00:00:00 2001 From: DeltaLima Date: Tue, 11 Jun 2024 16:29:35 +0200 Subject: [PATCH] =?UTF-8?q?vpn-with-ssh-tunnel.md=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vpn-with-ssh-tunnel.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 vpn-with-ssh-tunnel.md diff --git a/vpn-with-ssh-tunnel.md b/vpn-with-ssh-tunnel.md new file mode 100644 index 0000000..2d9b2f9 --- /dev/null +++ b/vpn-with-ssh-tunnel.md @@ -0,0 +1,17 @@ +``` +# tun device lokal anlegen für den user +$ ip tuntap add mode tun user mhanisch name tun0 + +# ip addresse vergeben +$ ip a add 10.12.34.1/30 dev tun0 + +# tun device lokal anlegen auf der gegenseite +$ ip tuntap add mode tun user root name tun0 +$ ip a add 10.12.34.2/30 dev tun0 + +# tunnel in sshd auf gegenseite in /etc/ssh/sshd_config erlauben +$ echo "PermitTunnel yes" >> /etc/ssh/sshd_config + +# per ssh tunnel verbindung aufbauen +$ ssh -w 0:0 root@1.2.3.4 +``` \ No newline at end of file