<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>IT notes - m1</title>
    <subtitle>DBRE, AWS platform engineering, PostgreSQL, Linux, FreeBSD, and Rust reference notes.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://nbari.com/tags/m1/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://nbari.com"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2024-04-17T07:40:17+00:00</updated>
    <id>https://nbari.com/tags/m1/atom.xml</id>
    <entry xml:lang="en">
        <title>headless mac gh-runner</title>
        <published>2024-04-17T07:40:17+00:00</published>
        <updated>2024-04-17T07:40:17+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://nbari.com/headless-mac/"/>
        <id>https://nbari.com/headless-mac/</id>
        
        <content type="html" xml:base="https://nbari.com/headless-mac/">&lt;p&gt;To install an apple via headless, first update:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; softwareupdate -iaR&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then configure ssh to only accept public-keys:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sudo vim /etc/ssh/sshd_config&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ensure you have this:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PasswordAuthentication no&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ChallengeResponseAuthentication no&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Reboot, test and then install homebrew:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;/bin/bash&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; -c&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt; &amp;quot;$(&lt;/span&gt;&lt;span class=&quot;z-12&quot;&gt;curl&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;)&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Create a &lt;code&gt;Brewfile&lt;/code&gt;&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; cat&lt;/span&gt;&lt;span&gt; $HOME&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt;/Brewfile&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;brew&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt;gmp&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;brew&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt;libyaml&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;brew&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt;tmux&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;brew&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt;ssh-vault&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Install with &lt;code&gt;brew bundle&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Create a user for Github Actions (runner)&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; dscl . -create /Users/gh-runner&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; dscl . -create /Users/gh-runner UserShell /bin/zsh&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; dscl . -create /Users/gh-runner RealName&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt;GitHub runner&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; dscl . -create /Users/gh-runner UniqueID&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt;1001&lt;/span&gt;&lt;span class=&quot;z-3&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; dscl . -create /Users/gh-runner PrimaryGroupID&lt;/span&gt;&lt;span class=&quot;z-10&quot;&gt; 20&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; dscl . -create /Users/gh-runner NFSHomeDirectory /Users/gh-runner&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-1 z-i&quot;&gt;# change password&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; dscl . -passwd /Users/gh-runner secret&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; dscl . -append /Groups/admin GroupMembership gh-runner&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-12&quot;&gt;sudo&lt;/span&gt;&lt;span class=&quot;z-7&quot;&gt; createhomedir -c&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Test:&lt;/p&gt;
&lt;pre class=&quot;giallo z-code&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;su - gh-runner&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</content>
        
    </entry>
</feed>
