<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>ssh on it-grossniklaus.ch</title>
    <link>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/</link>
    <description>Recent content in ssh on it-grossniklaus.ch</description>
    <generator>Hugo</generator>
    <language>de</language>
    <lastBuildDate>Mon, 01 Jan 0001 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Eigenen ssh Private Key auf Server installieren (authorized_keys)</title>
      <link>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/authorized-key/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/authorized-key/</guid>
      <description>&lt;!-- raw HTML omitted --&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;falls anmelden via User/Passwort möglich:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre class=&#34;terminal-in w3-theme-d5 notranslate&#34;&gt;&#xA;cd $HOME&#xA;mkdir     .ssh&#xA;chmod 700 .ssh&#xA;cd        .ssh&#xA;cat  &gt;&gt; authorized_keys    # dann copy/paste Inhalt von eigenem id_rsa.pub&#xA;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Eigenen ssh Private Key erstellen (ssh-keygen)</title>
      <link>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/ssh-keygen-create-key/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/ssh-keygen-create-key/</guid>
      <description>&lt;!-- raw HTML omitted --&gt;</description>
    </item>
    <item>
      <title>Eintrag aus eigenem known_hosts entfernen</title>
      <link>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/ssh-keygen-remove-entry/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/ssh-keygen-remove-entry/</guid>
      <description>&lt;pre class=&#34;terminal-in w3-theme-d5 notranslate&#34;&gt;&#xA;ssh-keygen -R example.com&#xA;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Filesytem via sftp mounten</title>
      <link>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/sshfs-mount/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/sshfs-mount/</guid>
      <description>&lt;!-- raw HTML omitted --&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://manpages.debian.org/testing/sshfs/sshfs.1.en.html&#34;&gt;https://manpages.debian.org/testing/sshfs/sshfs.1.en.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://manpages.debian.org/testing/fuse/fusermount.1.en.html&#34;&gt;https://manpages.debian.org/testing/fuse/fusermount.1.en.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre class=&#34;terminal-in w3-theme-d5 notranslate&#34;&gt;&#xA;sudo apt-get install sshfs&#xA;sudo adduser your_user_name fuse&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;als normaler user&#xA;&lt;pre class=&#34;terminal-in w3-theme-d5 notranslate&#34;&gt;&#xA;mkdir $HOME/sftp&#xA;sshfs user@remote.host.or.ip:/host/dir/to/mount $HOME/sftp&#xA;fusermount -u $HOME/sftp&#xA;&lt;/pre&gt;&#xA;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Passphrase des Keys ändern (ssh-keygen)</title>
      <link>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/ssh-keygen-passphrase/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/ssh-keygen-passphrase/</guid>
      <description>&lt;pre class=&#34;terminal-in w3-theme-d5 notranslate&#34;&gt;&#xA;cd $HOME/.ssh&#xA;ssh-keygen -f id_rsa -p&#xA;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>ssh relevante Config</title>
      <link>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/ssh-client-config/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/ssh-client-config/</guid>
      <description>&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://manpages.debian.org/testing/openssh-client/ssh_config.5.en.html&#34;&gt;https://manpages.debian.org/testing/openssh-client/ssh_config.5.en.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;code&gt;$HOME/.ssh/config&lt;/code&gt;&#xA;&lt;pre class=&#34;terminal-out w3-theme-l3 notranslate&#34;&gt;&#xA;Host *&#xA;    HashKnownHosts yes&#xA;    SendEnv LANG LC_*&#xA;&#xA;ServerAliveInterval=30&#xA;ServerAliveCountMax=10&#xA;TCPKeepAlive=yes&#xA;ConnectTimeout=30&#xA;&#xA;Host a_host_name&#xA;    HostName IP&#xA;    Port other_than_22&#xA;&lt;/pre&gt;&#xA;&lt;/p&gt;</description>
    </item>
    <item>
      <title>sshd relevante Config</title>
      <link>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/ssh-server-config/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/ssh-server-config/</guid>
      <description>&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://manpages.debian.org/testing/openssh-server/sshd_config.5.en.html&#34;&gt;https://manpages.debian.org/testing/openssh-server/sshd_config.5.en.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Authentication:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# soll mit Private Key (authorized_keys) als root verbunden werden dürfen?&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;PermitRootLogin without-password&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;TCPKeepAlive yes&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Allow client to pass locale environment variables&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;AcceptEnv LANG LC_*&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>Traffic komplett über einen Proxy leiten</title>
      <link>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/sshuttle/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/sshuttle/</guid>
      <description>&lt;!-- raw HTML omitted --&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://manpages.debian.org/testing/sshuttle/sshuttle.1.en.html&#34;&gt;sshuttle.1.en.html&lt;/a&gt; &lt;em&gt;(manpages.debian.org)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;debian-ab-stretch&#34;&gt;Debian ab stretch:&lt;/h2&gt;&#xA;&lt;pre class=&#34;terminal-in w3-theme-d5 notranslate&#34;&gt;&#xA;sudo apt-get install sshuttle&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;h2 id=&#34;sshuttle-selber-bauen&#34;&gt;sshuttle selber bauen&lt;/h2&gt;&#xA;&lt;pre class=&#34;terminal-in w3-theme-d5 notranslate&#34;&gt;&#xA;sudo apt-get install git&#xA;git clone git://github.com/sshuttle/sshuttle&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;pre class=&#34;terminal-in w3-theme-d5 notranslate&#34;&gt;&#xA;./sshuttle -r Proxy_IP NETZ_zum_Umleiten&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Kontrolle&#xA;&lt;pre class=&#34;terminal-in w3-theme-d5 notranslate&#34;&gt;&#xA;iptables -t nat -n -L&#xA;&lt;/pre&gt;&#xA;&lt;/p&gt;&#xA;&lt;h2 id=&#34;sshuttle-verwenden&#34;&gt;sshuttle verwenden&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The most basic use of sshuttle looks like&#xA;0/0 is shortcut for 0.0.0.0/0&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;pre class=&#34;terminal-in w3-theme-d5 notranslate&#34;&gt;&#xA;./sshuttle       -r username@sshserver 0/0 -vv&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;DNS queries to be proxied through the DNS server&#xA;of the server you are connect to&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tunnel mit ssh</title>
      <link>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/ssh-tunneling/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://it-grossniklaus.ch/pages/topics/tools/snippets/ssh/ssh-tunneling/</guid>
      <description>&lt;!-- raw HTML omitted --&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://manpages.debian.org/testing/openssh-client/ssh.1.en.html&#34;&gt;https://manpages.debian.org/testing/openssh-client/ssh.1.en.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1 id=&#34;als-root&#34;&gt;als root&lt;/h1&gt;&#xA;&lt;pre class=&#34;terminal-in w3-theme-d5 notranslate&#34;&gt;&#xA;sudo ssh user_auf_example@example.com -L 127.0.0.101:8080:Ziel_IP_von_example_aus:80&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;geht effektiv von example.com aus auf Ziel_IP Port 80&#xA;&lt;pre class=&#34;terminal-in w3-theme-d5 notranslate&#34;&gt;&#xA;lynx http://127.0.0.101:8080/server-status&#xA;&lt;/pre&gt;&#xA;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
