<?xml version="1.0" encoding="utf-8" standalone="yes"?><?xml-stylesheet type="text/xsl" href="https://perrotta.dev/rss.xsl"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ssh on ¬ just serendipity 🍀</title>
    <link>https://perrotta.dev/</link>
    <description>Recent content in Ssh on ¬ just serendipity 🍀</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <managingEditor>serendipity@perrotta.dev (Thiago Perrotta)</managingEditor>
    <webMaster>serendipity@perrotta.dev (Thiago Perrotta)</webMaster>
    <copyright>© 2013 - 2026 Thiago Perrotta ·
  a fork of [hugo ʕ•ᴥ•ʔ bear](https://github.com/janraasch/hugo-bearblog/)
</copyright>
    <lastBuildDate>Thu, 26 Mar 2026 18:46:44 +0100</lastBuildDate>
    <atom:link href="https://perrotta.dev/tags/ssh/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>★ New script: SSH mux restart
      </title>
      <link>https://perrotta.dev/2025/10/new-script-ssh-mux-restart/</link>
      <pubDate>Thu, 30 Oct 2025 12:59:53 +0100</pubDate><author>serendipity@perrotta.dev (Thiago Perrotta)</author>
      <category>bestof</category>
      <category>dev</category>
      <category>ssh</category>
      <guid>https://perrotta.dev/2025/10/new-script-ssh-mux-restart/</guid>
      <description>&lt;p&gt;♠ &lt;a href=&#34;https://perrotta.dev/2025/10/github-the-organization-has-enabled-or-enforced-saml-sso/&#34;&gt;Previously&lt;/a&gt;,&#xA;&lt;a href=&#34;https://perrotta.dev/2025/05/1password-ssh-agent-error/&#34;&gt;previously&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;After experiencing almost daily frustration because of this SSH auth issue, I&#xA;decided to script a solution out of it: and now&#xA;&lt;a href=&#34;https://github.com/thiagowfx/pancake/tree/8707d1792c0d1266180dfa3d49c7d144c71ef23d/ssh_mux_restart&#34;&gt;&lt;code&gt;ssh_mux_restart&lt;/code&gt;&lt;/a&gt;&#xA;was born.&lt;/p&gt;&#xA;&lt;p&gt;A copy of the &lt;code&gt;README.md&lt;/code&gt; follows below for ease of reference.&lt;/p&gt;&#xA;&lt;p&gt;The use case is very simple: run the &lt;code&gt;ssh_mux_restart&lt;/code&gt; script whenever I run&#xA;into a git SSH authentication error, typically due to &lt;code&gt;git pull&lt;/code&gt;, &lt;code&gt;git fetch&lt;/code&gt; or&#xA;&lt;code&gt;git push&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;usage&#34;&gt;&#xA;  Usage&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;https://perrotta.dev/2025/10/new-script-ssh-mux-restart/#usage&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Basic usage to kill SSH multiplexed connections:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;./ssh_mux_restart.sh&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;To also restart the 1Password SSH agent:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;./ssh_mux_restart.sh --restart-1password&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;example-output&#34;&gt;&#xA;  Example Output&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;https://perrotta.dev/2025/10/new-script-ssh-mux-restart/#example-output&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-plaintext&#34;&gt;% ./ssh_mux_restart.sh&#xA;Finding SSH multiplexed connections...&#xA;Found SSH multiplexed connections:&#xA;  88002 ssh: /tmp/ssh-control-FLAPJACK42 [mux]&#xA;  88123 ssh: /tmp/ssh-control-WAFFLE55 [mux]&#xA;Killing SSH multiplexed connections...&#xA;✓ Killed SSH mux process: 88002&#xA;✓ Killed SSH mux process: 88123&#xA;Killed 2/2 SSH multiplexed connections.&#xA;&#xA;All operations completed successfully!&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;With the &lt;code&gt;--restart-1password&lt;/code&gt; flag:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-plaintext&#34;&gt;% ./ssh_mux_restart.sh --restart-1password&#xA;Finding SSH multiplexed connections...&#xA;Found SSH multiplexed connections:&#xA;  88002 ssh: /tmp/ssh-control-PANCAKE99 [mux]&#xA;Killing SSH multiplexed connections...&#xA;✓ Killed SSH mux process: 88002&#xA;Killed 1/1 SSH multiplexed connections.&#xA;&#xA;Restarting 1Password application...&#xA;Found 1Password process: 67690&#xA;Quitting 1Password...&#xA;✓ 1Password quit successfully&#xA;Starting 1Password...&#xA;✓ 1Password started successfully&#xA;1Password SSH agent is now ready for use.&#xA;&#xA;All operations completed successfully!&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;why-this-matters&#34;&gt;&#xA;  Why This Matters&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;https://perrotta.dev/2025/10/new-script-ssh-mux-restart/#why-this-matters&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;SSH multiplexed connections can cache stale authentication credentials, causing issues when:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GitHub organizations enable or enforce SAML SSO&lt;/li&gt;&#xA;&lt;li&gt;1Password SSH agent credentials need refreshing&lt;/li&gt;&#xA;&lt;li&gt;SSH keys have been rotated or updated&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Restarting these connections forces SSH to re-authenticate with fresh credentials.&lt;/p&gt;&#xA;&lt;h2 id=&#34;prerequisites&#34;&gt;&#xA;  Prerequisites&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;https://perrotta.dev/2025/10/new-script-ssh-mux-restart/#prerequisites&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Standard Unix tools (&lt;code&gt;pgrep&lt;/code&gt;, &lt;code&gt;pkill&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;1Password app (macOS) if using the &lt;code&gt;--restart-1password&lt;/code&gt; flag&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;— § —&lt;/p&gt;&lt;p&gt;Reply via &lt;a href=&#34;mailto:serendipity@perrotta.dev?subject=Reply to: New script: SSH mux restart&#34;&gt;email&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&#34;https://perrotta.dev/tags/bestof/&#34;&gt;#bestof&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/dev/&#34;&gt;#dev&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/ssh/&#34;&gt;#ssh&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>GitHub: the organization has enabled or enforced SAML sso
      </title>
      <link>https://perrotta.dev/2025/10/github-the-organization-has-enabled-or-enforced-saml-sso/</link>
      <pubDate>Tue, 21 Oct 2025 08:15:41 +0200</pubDate><author>serendipity@perrotta.dev (Thiago Perrotta)</author>
      <category>dev</category>
      <category>security</category>
      <category>ssh</category>
      <guid>https://perrotta.dev/2025/10/github-the-organization-has-enabled-or-enforced-saml-sso/</guid>
      <description>&lt;p&gt;♠ Error message when doing &lt;code&gt;git push&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-plaintext&#34;&gt;% git push&#xA;ERROR: The &amp;#39;{corp}&amp;#39; organization has enabled or enforced SAML SSO.&#xA;To access this repository, you must use the HTTPS remote with a personal access token or SSH with an SSH key and passphrase that has been authorized for this organization.&#xA;Visit https://docs.github.com/articles/authenticating-to-a-github-organization-with-saml-single-sign-on/ for more information.&#xA;&#xA;fatal: Could not read from remote repository.&#xA;&#xA;Please make sure you have the correct access rights&#xA;and the repository exists.&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Even after authenticating by logging in, the error persists.&lt;/p&gt;&#xA;&lt;p&gt;The solution is to &lt;strong&gt;restart the ssh agent&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;How to do so is out of scope of this post, because it depends on which one you&#xA;use.&lt;/p&gt;&#xA;&lt;p&gt;For the 1Password ssh agent, the following has worked for me:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;disable it by toggling the checkbox: Settings &amp;gt; Developer &amp;gt; SSH Agent &amp;gt; Use the SSH Agent&lt;/li&gt;&#xA;&lt;li&gt;kill the ssh agent (&lt;code&gt;pkill ssh-agent&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;kill open ssh multiplexing connections (e.g. with &lt;code&gt;pkill&lt;/code&gt;):&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-plaintext&#34;&gt;% pgrep -afl ssh&#xA;48564 ssh: /tmp/ssh-control-bda8786786c69753cc9ddd9fb7c06aaff3768a70 [mux]&#xA;50845 ssh: /tmp/ssh-control-bda8786786c69753cc9ddd9fb7c06aaff3768a70 [mux]&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;quit 1Password, then reopen it&lt;/li&gt;&#xA;&lt;li&gt;re-enable the 1Password ssh agent&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;git push&lt;/code&gt; again&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Surely there is a way to script this?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Update(2025-10-28)&lt;/strong&gt;: In a second try, killing the process below was enough to&#xA;address the issue.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-plaintext&#34;&gt;% pgrep -afl ssh&#xA;7242 ssh: /tmp/ssh-control-bda8786786c69753cc9ddd9fb7c06aaff3768a70 [mux]&#xA;% kill 7242&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;— § —&lt;/p&gt;&lt;p&gt;Reply via &lt;a href=&#34;mailto:serendipity@perrotta.dev?subject=Reply to: GitHub: the organization has enabled or enforced SAML sso&#34;&gt;email&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&#34;https://perrotta.dev/tags/dev/&#34;&gt;#dev&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/security/&#34;&gt;#security&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/ssh/&#34;&gt;#ssh&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>SSH: hash known hosts
      </title>
      <link>https://perrotta.dev/2025/06/ssh-hash-known-hosts/</link>
      <pubDate>Sun, 15 Jun 2025 12:05:11 +0200</pubDate><author>serendipity@perrotta.dev (Thiago Perrotta)</author>
      <category>dev</category>
      <category>privacy</category>
      <category>security</category>
      <category>ssh</category>
      <guid>https://perrotta.dev/2025/06/ssh-hash-known-hosts/</guid>
      <description>&lt;p&gt;♠ A security / privacy tip: hash ssh hosts, especially in machines you have&#xA;access to that are in the cloud.&#xA;&lt;a href=&#34;https://github.com/thiagowfx/.dotfiles/blob/6a5bb6a20eeede82dfcbbc56ef4db91ffe2dd65d/ssh/.ssh/config#L40-L42&#34;&gt;&lt;code&gt;~/.ssh/config&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-plaintext&#34;&gt;Host *&#xA;&#x9;# Automatically hash new host keys added to ~/.ssh/known_hosts.&#xA;&#x9;# Manually for pre-existing hosts: ssh-keygen -H&#xA;&#x9;HashKnownHosts yes&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The default is not to hash.&lt;/p&gt;&#xA;&lt;p&gt;As a side effect, &lt;code&gt;~/.ssh/known_hosts&lt;/code&gt; (sample entry):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-plaintext&#34;&gt;|1|F1E1KeoE/eEWhi10WpGv4OdiO6Y=|3988QV0VE8wmZL7suNrYQLITLCg= sh-ed25519 [...]&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Why do this? As per &lt;a href=&#34;https://security.stackexchange.com/questions/56268/ssh-benefits-of-using-hashed-known-hosts&#34;&gt;Security Stack Exchange&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The only change is that if a machine is compromised, the idea is to minimize&#xA;how much usable information is given to an attacker.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;To retroactively hash existing entries, run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;% ssh-keygen -H&#xA;/Users/tperrotta/.ssh/known_hosts updated.&#xA;Original contents retained as /Users/tperrotta/.ssh/known_hosts.old&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;— § —&lt;/p&gt;&lt;p&gt;Reply via &lt;a href=&#34;mailto:serendipity@perrotta.dev?subject=Reply to: SSH: hash known hosts&#34;&gt;email&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&#34;https://perrotta.dev/tags/dev/&#34;&gt;#dev&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/privacy/&#34;&gt;#privacy&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/security/&#34;&gt;#security&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/ssh/&#34;&gt;#ssh&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>git pull: authentication issues
      </title>
      <link>https://perrotta.dev/2025/06/git-pull-authentication-issues/</link>
      <pubDate>Tue, 03 Jun 2025 14:35:04 +0200</pubDate><author>serendipity@perrotta.dev (Thiago Perrotta)</author>
      <category>dev</category>
      <category>git</category>
      <category>security</category>
      <category>ssh</category>
      <guid>https://perrotta.dev/2025/06/git-pull-authentication-issues/</guid>
      <description>&lt;p&gt;♠ &lt;code&gt;git pull&lt;/code&gt; authentication issues is &lt;em&gt;really&lt;/em&gt; a disguise for &lt;code&gt;ssh&lt;/code&gt; auth issues.&lt;/p&gt;&#xA;&lt;p&gt;Today a teammate could not &lt;code&gt;git pull&lt;/code&gt; one of our internal repos:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-plaintext&#34;&gt;% git pull&#xA;Enter passphrase for key &amp;#39;/Users/user/.ssh/id_ed25519&amp;#39;:&#xA;git@github.com: Permission denied (publickey).&#xA;fatal: Could not read from remote repository.&#xA;&#xA;Please make sure you have the correct access rights&#xA;and the repository exists.&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The first thing we verified was that his public key was&#xA;&lt;a href=&#34;https://github.com/settings/keys&#34;&gt;added&lt;/a&gt; to his github profile, and that the&#xA;private key was present in &lt;code&gt;~/.ssh/id_ed25519&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Next, verify &lt;code&gt;~/.ssh/config&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-plaintext&#34;&gt;Host github.com&#xA;AddKeysToAgent yes&#xA;UseKeychain yes&#xA;IdentityFile ~/.ssh/id_ed25519&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Looks fine. Then:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;% export GIT_SSH_COMMAND=&amp;#34;ssh -vvv&amp;#34;&#xA;% git pull&#xA;[...]&#xA;debug3: Search for item with query: {&#xA;    acct = &amp;#34;/Users/user/.ssh/id_ed25519&amp;#34;;&#xA;    agrp = &amp;#34;com.apple.ssh.passphrases&amp;#34;;&#xA;    class = genp;&#xA;    labl = &amp;#34;SSH: /Users/user/.ssh/id_ed25519&amp;#34;;&#xA;    nleg = 1;&#xA;    &amp;#34;r_Data&amp;#34; = 1;&#xA;    svce = OpenSSH;&#xA;    &amp;#34;u_AuthUI&amp;#34; = &amp;#34;u_AuthUIF&amp;#34;;&#xA;}&#xA;debug2: Unexpected keychain error while searching for an item: User interaction is not allowed.&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Herein lies the error! The interaction with the system keychain in macOS was not&#xA;successful.&lt;/p&gt;&#xA;&lt;p&gt;I suggested him to remove &lt;code&gt;AddKeysToAgent&lt;/code&gt; and &lt;code&gt;UseKeychain&lt;/code&gt; from this config&#xA;file, but that did not work either:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;% git pull&#xA;[...]&#xA;Enter passphrase for key &amp;#39;/Users/user/.ssh/id_ed25519&amp;#39;:&#xA;debug2: no passphrase given, try next key&#xA;debug2: we did not send a packet, disable method&#xA;debug1: No more authentication methods to try.&#xA;git@github.com: Permission denied (publickey).&#xA;fatal: Could not read from remote repository.&#xA;&#xA;Please make sure you have the correct access rights&#xA;and the repository exists.&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The ssh key is protected with a passphrase.&lt;/p&gt;&#xA;&lt;p&gt;In this case, it&amp;rsquo;s better to fix the keychain issue. We readd the two deleted&#xA;lines.&lt;/p&gt;&#xA;&lt;p&gt;Restart the &lt;code&gt;ssh-agent&lt;/code&gt; and readd the key there:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;% eval &amp;#34;$(ssh-agent -s)&amp;#34;&#xA;% ssh-add -K ~/.ssh/id_ed25519&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Problem resolved! &lt;code&gt;git pull&lt;/code&gt; works now.&lt;/p&gt;&#xA;&lt;p&gt;— § —&lt;/p&gt;&lt;p&gt;Reply via &lt;a href=&#34;mailto:serendipity@perrotta.dev?subject=Reply to: git pull: authentication issues&#34;&gt;email&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&#34;https://perrotta.dev/tags/dev/&#34;&gt;#dev&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/git/&#34;&gt;#git&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/security/&#34;&gt;#security&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/ssh/&#34;&gt;#ssh&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>1Password SSH agent error
      </title>
      <link>https://perrotta.dev/2025/05/1password-ssh-agent-error/</link>
      <pubDate>Wed, 07 May 2025 12:52:00 +0200</pubDate><author>serendipity@perrotta.dev (Thiago Perrotta)</author>
      <category>dev</category>
      <category>macos</category>
      <category>security</category>
      <category>ssh</category>
      <guid>https://perrotta.dev/2025/05/1password-ssh-agent-error/</guid>
      <description>&lt;p&gt;♠ A day in the life:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;% ssh {my-server}&#xA;STDERR:&#xA;    sign_and_send_pubkey: signing failed for ED25519 &amp;#34;/Users/thiago/.ssh/id_ed25519&amp;#34; from agent: agent refused operation&#xA;&#xA;    git@github.com: Permission denied (publickey).&#xA;&#xA;    fatal: Could not read from remote repository.&#xA;&#xA;    Please make sure you have the correct access rights&#xA;&#xA;    and the repository exists.&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;What&amp;rsquo;s the matter?&lt;/p&gt;&#xA;&lt;p&gt;My ssh config is integrated with the &lt;a href=&#34;https://developer.1password.com/docs/ssh/agent/&#34;&gt;1Password ssh&#xA;agent&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-plaintext&#34;&gt;Host *&#xA;        # Use 1Password SSH agent when available&#xA;        # macOS only&#xA;        # Linux: &amp;#34;~/.1password/agent.sock&amp;#34;&#xA;        IdentityAgent &amp;#34;~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock&amp;#34;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Ensure 1Password is unlocked, so that the agent can be used.&lt;/p&gt;&#xA;&lt;p&gt;It can be unlocked from its macOS app, or from the CLI (&lt;code&gt;op signin --account {my-account}&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;— § —&lt;/p&gt;&lt;p&gt;Reply via &lt;a href=&#34;mailto:serendipity@perrotta.dev?subject=Reply to: 1Password SSH agent error&#34;&gt;email&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&#34;https://perrotta.dev/tags/dev/&#34;&gt;#dev&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/macos/&#34;&gt;#macos&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/security/&#34;&gt;#security&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/ssh/&#34;&gt;#ssh&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Be aware that your public SSH keys can reveal your identity
      </title>
      <link>https://perrotta.dev/2024/05/be-aware-that-your-public-ssh-keys-can-reveal-your-identity/</link>
      <pubDate>Fri, 03 May 2024 16:46:28 +0200</pubDate><author>serendipity@perrotta.dev (Thiago Perrotta)</author>
      <category>dev</category>
      <category>privacy</category>
      <category>security</category>
      <category>ssh</category>
      <guid>https://perrotta.dev/2024/05/be-aware-that-your-public-ssh-keys-can-reveal-your-identity/</guid>
      <description>&lt;p&gt;♠ If you have a GitHub account configured with SSH, your public keys are available&#xA;at &lt;code&gt;https://github.com/$USERNAME.keys&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For example, mine: &lt;a href=&#34;https://github.com/thiagowfx.keys&#34;&gt;https://github.com/thiagowfx.keys&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;And then let&amp;rsquo;s say you also use your full name on GitHub.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-plaintext&#34;&gt;% ssh whoami.filippo.io&#xA;The authenticity of host &amp;#39;whoami.filippo.io (2a09:8280:1::a:5d6)&amp;#39; can&amp;#39;t be established.&#xA;ED25519 key fingerprint is SHA256:qGAqPqtlvFBCt4LfMME3IgJqZWlcrlBMxNmGjhLVYzY.&#xA;This key is not known by any other names.&#xA;Are you sure you want to continue connecting (yes/no/[fingerprint])? yes&#xA;Warning: Permanently added &amp;#39;whoami.filippo.io&amp;#39; (ED25519) to the list of known hosts.&#xA;&#xA;    &amp;#43;---------------------------------------------------------------------&amp;#43;&#xA;    |                                                                     |&#xA;    |             _o/ Hello Thiago Perrotta!&#xA;    |                                                                     |&#xA;    |                                                                     |&#xA;    |  Did you know that ssh sends all your public keys to any server     |&#xA;    |  it tries to authenticate to?                                       |&#xA;    |                                                                     |&#xA;    |  We matched them to the keys of your GitHub account,                |&#xA;    |  @thiagowfx, which are available via the GraphQL API&#xA;    |  and at https://github.com/thiagowfx.keys&#xA;    |                                                                     |&#xA;    |  -- Filippo (https://filippo.io)                                    |&#xA;    |                                                                     |&#xA;    |                                                                     |&#xA;    |  P.S. The source of this server is at                               |&#xA;    |  https://github.com/FiloSottile/whoami.filippo.io                   |&#xA;    |                                                                     |&#xA;    &amp;#43;---------------------------------------------------------------------&amp;#43;&#xA;&#xA;Shared connection to whoami.filippo.io closed.&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Then be careful when connecting to random public ssh servers when you have an&#xA;intent to be anonymous.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s possible to &amp;ldquo;hide&amp;rdquo; yourself by either setting the &lt;code&gt;IdentitiesOnly=yes&lt;/code&gt;&#xA;option, or by removing all your local ssh keys altogether, even if only&#xA;temporarily.&lt;/p&gt;&#xA;&lt;p&gt;— § —&lt;/p&gt;&lt;p&gt;Reply via &lt;a href=&#34;mailto:serendipity@perrotta.dev?subject=Reply to: Be aware that your public SSH keys can reveal your identity&#34;&gt;email&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&#34;https://perrotta.dev/tags/dev/&#34;&gt;#dev&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/privacy/&#34;&gt;#privacy&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/security/&#34;&gt;#security&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/ssh/&#34;&gt;#ssh&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>★ SSH plus tmux automatically
      </title>
      <link>https://perrotta.dev/2022/02/ssh-plus-tmux-automatically/</link>
      <pubDate>Sun, 13 Feb 2022 20:20:27 -0500</pubDate><author>serendipity@perrotta.dev (Thiago Perrotta)</author>
      <category>bestof</category>
      <category>dev</category>
      <category>security</category>
      <category>ssh</category>
      <guid>https://perrotta.dev/2022/02/ssh-plus-tmux-automatically/</guid>
      <description>&lt;p&gt;♠ One of the most classic sysadmin/DevOps tasks is to use secure shell to connect to remote machines.&lt;/p&gt;&#xA;&lt;p&gt;To persist those connections, a terminal multiplexer is often used, &lt;code&gt;tmux&lt;/code&gt; and &lt;code&gt;screen&lt;/code&gt; being the two most popular ones.&lt;/p&gt;&#xA;&lt;p&gt;In this post I will cover a few different client-side and server-side ways to have &lt;code&gt;ssh&lt;/code&gt; automatically spawn &lt;code&gt;tmux&lt;/code&gt; upon connection.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-1-use-command-line-ssh-flags-client-side-recommended&#34;&gt;&#xA;  Option #1: Use command-line ssh flags (client-side, recommended)&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;https://perrotta.dev/2022/02/ssh-plus-tmux-automatically/#option-1-use-command-line-ssh-flags-client-side-recommended&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Start &lt;code&gt;tmux&lt;/code&gt;, forcing unicode, attaching to and/or creating a session named &lt;em&gt;main&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;$ ssh user@host -t -- tmux -u new -A -s main&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;-u&lt;/code&gt; is not strictly necessary, however I experienced occasional weirdness when connecting to some machines and omitting it. Some unicode characters wouldn&amp;rsquo;t be properly rendered, like the horizontal and vertical lines used to render tmux pane splits. Even though most machines should work just fine these days by supporting UTF-8 out-of-the-box, it&amp;rsquo;s safer to always include &lt;code&gt;-u&lt;/code&gt; just in case.&lt;/p&gt;&#xA;&lt;p&gt;Tip: If it&amp;rsquo;s annoying to remember to type the full command above, consider adding an &lt;code&gt;alias&lt;/code&gt; in your shell config. Alternatively, use a ssh client that remembers your flags preferences such as the &lt;a href=&#34;https://chrome.google.com/webstore/detail/secure-shell/iodihamcpbpeioajjeobimgagajmlibd?hl=en&#34;&gt;chrome secure shell&lt;/a&gt; extension.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-2-use-sshconfig-client-side&#34;&gt;&#xA;  Option #2: Use &lt;code&gt;~/.ssh/config&lt;/code&gt; (client-side)&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;https://perrotta.dev/2022/02/ssh-plus-tmux-automatically/#option-2-use-sshconfig-client-side&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;This option is very similar to the previous one, but the flags live in the ssh config rather then being specified at the command line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-plaintext&#34;&gt;Host *&#xA;  RequestTTY yes&#xA;  RemoteCommand tmux -u new -A -s main&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You don&amp;rsquo;t need to match all hosts (&lt;code&gt;Host *&lt;/code&gt;), if you&amp;rsquo;d rather match one or more specific hosts, refer to the ssh config syntax &lt;code&gt;ssh_config(5)&lt;/code&gt; to add them. A simple example would be &lt;code&gt;Host mymachine.example.org&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Caveat&lt;/strong&gt;: I&amp;rsquo;ve found this method interferes with &lt;code&gt;git&lt;/code&gt; + &lt;code&gt;ssh&lt;/code&gt; authentication. More specifically:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;$ git remote -v&#xA;origin&#x9;git@github.com:thiagowfx/.dotfiles.git (fetch)&#xA;origin&#x9;git@github.com:thiagowfx/.dotfiles.git (push)&#xA;$ git push&#xA;Cannot execute command-line and remote command.&#xA;fatal: Could not read from remote repository.&#xA;&#xA;Please make sure you have the correct access rights&#xA;and the repository exists.&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Therefore I discourage it, unless you only use it with specific hosts i.e. don&amp;rsquo;t use it with &lt;code&gt;Host *&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;option-3-use-bash_profile-or-similar-server-side-recommended&#34;&gt;&#xA;  Option #3: Use &lt;code&gt;~/.bash_profile&lt;/code&gt; or similar (server-side, recommended)&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;https://perrotta.dev/2022/02/ssh-plus-tmux-automatically/#option-3-use-bash_profile-or-similar-server-side-recommended&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;This method leverages your login shell startup config file (&lt;code&gt;~/.bash_profile&lt;/code&gt;, &lt;code&gt;~/.zprofile&lt;/code&gt;, etc) to automatically spawn &lt;code&gt;tmux&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;# This file is invoked as part of my ~/.bash_profile.&#xA;# Automatically spawn tmux within ssh sessions for interactive terminals.&#xA;# https://stackoverflow.com/a/43819740/1745064&#xA;#&#xA;# The session is called `main`.&#xA;# Create a session with PREFIX :new, rename with PREFIX $, toggle with PREFIX s.&#xA;#&#xA;# Escape hatch:&#xA;#   ssh &amp;lt;host&amp;gt; -t -- NOTMUX=1 &amp;lt;shell&amp;gt;&#xA;if [ -z &amp;#34;$NOTMUX&amp;#34; ] &amp;amp;&amp;amp; [ -z &amp;#34;$TMUX&amp;#34; ] &amp;amp;&amp;amp; [ -n &amp;#34;$SSH_TTY&amp;#34; ] &amp;amp;&amp;amp; [[ $- =~ i ]]; then&#xA;  tmux -u new -A -s main&#xA;  exit&#xA;fi&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The &lt;code&gt;if&lt;/code&gt; basically checks:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;whether we&amp;rsquo;re not already inside a tmux session (we shouldn&amp;rsquo;t be), so that we don&amp;rsquo;t nest &lt;code&gt;tmux&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;whether we&amp;rsquo;re accessing the shell via &lt;code&gt;ssh&lt;/code&gt; (we should be)&lt;/li&gt;&#xA;&lt;li&gt;whether we&amp;rsquo;re accessing an interactive shell (we should be), so that it doesn&amp;rsquo;t interfere with oneshot &lt;code&gt;ssh&lt;/code&gt; commands&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;There&amp;rsquo;s also a escape hatch. If you want to get an interactive shell but bypass &lt;code&gt;tmux&lt;/code&gt; for some reason&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;https://perrotta.dev/2022/02/ssh-plus-tmux-automatically/#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;, just set &lt;code&gt;NOTMUX=1&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;$ ssh user@host -t -- NOTMUX=1 bash&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;final-remarks&#34;&gt;&#xA;  Final remarks&#xA;  &lt;a class=&#34;heading-anchor&#34; href=&#34;https://perrotta.dev/2022/02/ssh-plus-tmux-automatically/#final-remarks&#34; aria-label=&#34;Link to this section&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;My favorite methods are #1 and #3, and whether I use one or the other depends whether I want to unconditionally spawn &lt;code&gt;tmux&lt;/code&gt; server-side, or selectively spawn &lt;code&gt;tmux&lt;/code&gt; client-side.&lt;/p&gt;&#xA;&lt;p&gt;When using chrome secure shell (hterm) I find #1 convenient because hterm remembers your &lt;code&gt;ssh&lt;/code&gt; host settings. That said, in scenarios where I fully control a host and it&amp;rsquo;s not solely used for production, #3 is my favorite as it works unconditionally regardless of the client terminal emulator I am using.&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;For example, maybe if &lt;code&gt;tmux&lt;/code&gt; broke due to a recent upgrade, or if the &lt;code&gt;~/.tmux.conf&lt;/code&gt; is invalid.&amp;#160;&lt;a href=&#34;https://perrotta.dev/2022/02/ssh-plus-tmux-automatically/#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;— § —&lt;/p&gt;&lt;p&gt;Reply via &lt;a href=&#34;mailto:serendipity@perrotta.dev?subject=Reply to: SSH plus tmux automatically&#34;&gt;email&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&#34;https://perrotta.dev/tags/bestof/&#34;&gt;#bestof&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/dev/&#34;&gt;#dev&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/security/&#34;&gt;#security&lt;/a&gt; &lt;a href=&#34;https://perrotta.dev/tags/ssh/&#34;&gt;#ssh&lt;/a&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
