<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://wiki.nathancampos.me/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://wiki.nathancampos.me/feed.php">
        <title>Nathan&#039;s KB - notes</title>
        <description>Hello</description>
        <link>http://wiki.nathancampos.me/</link>
        <image rdf:resource="http://wiki.nathancampos.me/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-05-13T09:01:56+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://wiki.nathancampos.me/doku.php?id=notes:change-uid"/>
                <rdf:li rdf:resource="http://wiki.nathancampos.me/doku.php?id=notes:fix-unix-perms"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://wiki.nathancampos.me/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>Nathan's KB</title>
        <link>http://wiki.nathancampos.me/</link>
        <url>http://wiki.nathancampos.me/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="http://wiki.nathancampos.me/doku.php?id=notes:change-uid">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-11T13:48:27+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>change-uid</title>
        <link>http://wiki.nathancampos.me/doku.php?id=notes:change-uid</link>
        <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;changing_a_user_s_uid&quot;&gt;Changing a User&amp;#039;s UID&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
Having consistency of UID and GID on UNIX is extremely important if you have multiple servers and clients that you want to maintain a consistent identity on. Be it for &lt;a href=&quot;https://en.wikipedia.org/wiki/Network_File_System&quot; class=&quot;urlextern&quot; title=&quot;https://en.wikipedia.org/wiki/Network_File_System&quot; rel=&quot;ugc nofollow&quot;&gt;NFS&lt;/a&gt;, &lt;a href=&quot;https://git-scm.com/&quot; class=&quot;urlextern&quot; title=&quot;https://git-scm.com/&quot; rel=&quot;ugc nofollow&quot;&gt;Git&lt;/a&gt;, or any other administrative task. Having the same IDs for your users across different computers really helps.
&lt;/p&gt;

&lt;p&gt;
Sadly, almost no &lt;abbr title=&quot;Operating System&quot;&gt;OS&lt;/abbr&gt; install utilities allow you to specify the UID/GID of the default user that&amp;#039;s created during setup, which means we have to do this afterward, thus this tutorial exists to give me and everyone a clear path to UID consistency.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Changing a User&amp;#039;s UID&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;changing_a_user_s_uid&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-651&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;linux&quot;&gt;Linux&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
I almost always run &lt;a href=&quot;https://www.debian.org/&quot; class=&quot;urlextern&quot; title=&quot;https://www.debian.org/&quot; rel=&quot;ugc nofollow&quot;&gt;Debian&lt;/a&gt; on my Linux machines, thus I can&amp;#039;t say this is the right way of doing it in other distros, I can&amp;#039;t see why it wouldn&amp;#039;t apply to others as well.
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Ensure no processes are running from the old user.&lt;/span&gt;
pkill &lt;span class=&quot;re5&quot;&gt;-U&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$OLD_UID&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Change UID/GID using usermod.&lt;/span&gt;
usermod &lt;span class=&quot;re5&quot;&gt;-u&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$NEW_UID&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-g&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$NEW_GID&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$USERNAME&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Fix file permissions to use the new UID.&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;find&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-uid&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$OLD_UID&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-exec&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;chown&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-h&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$NEW_UID&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; +
&lt;span class=&quot;kw2&quot;&gt;find&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-gid&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$OLD_UID&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-exec&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;chgrp&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-h&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$NEW_GID&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; +&lt;/pre&gt;

&lt;p&gt;
If you&amp;#039;re using a Raspberry Pi with its graphical desktop environment, you should use &lt;code&gt;raspi-config&lt;/code&gt; to disable booting straight to X.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Linux&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;linux&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;652-&amp;quot;} --&gt;</description>
    </item>
    <item rdf:about="http://wiki.nathancampos.me/doku.php?id=notes:fix-unix-perms">
        <dc:format>text/html</dc:format>
        <dc:date>2023-10-09T15:53:52+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>fix-unix-perms</title>
        <link>http://wiki.nathancampos.me/doku.php?id=notes:fix-unix-perms</link>
        <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;fixing_unix_permissions&quot;&gt;Fixing UNIX Permissions&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
Recently, because of a long due migration from Windows file servers and separate Linux file servers to a single multi-drive-bay server chassis running multiple FreeBSD VMs we had to deal with a bunch of permission issues. The best way to solve these was to run the following commands:
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;find&lt;/span&gt; . &lt;span class=&quot;re5&quot;&gt;-type&lt;/span&gt; d &lt;span class=&quot;re5&quot;&gt;-not&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-path&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;./.snap&amp;quot;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-exec&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;chmod&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;775&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; \;
&lt;span class=&quot;kw2&quot;&gt;find&lt;/span&gt; . &lt;span class=&quot;re5&quot;&gt;-type&lt;/span&gt; f &lt;span class=&quot;re5&quot;&gt;-not&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-path&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;./.snap/*&amp;quot;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-exec&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;chmod&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;664&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; \;&lt;/pre&gt;

&lt;p&gt;
These take care to ignore the &lt;code&gt;.snap&lt;/code&gt; snapshot directory that&amp;#039;s created by FreeBSD, otherwise, you&amp;#039;ll have issues down the line.
&lt;/p&gt;

&lt;p&gt;
Also, if you want to ensure that the entire filesystem respects the default layout for shared files where directories are &lt;code&gt;775&lt;/code&gt; and files are &lt;code&gt;664&lt;/code&gt;. If you also require a change in owner or group you can also run the following commands:
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;find&lt;/span&gt; . &lt;span class=&quot;re5&quot;&gt;-type&lt;/span&gt; d &lt;span class=&quot;re5&quot;&gt;-not&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-path&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;./.snap&amp;quot;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-exec&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;chown&lt;/span&gt; nathanpc:staff &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; \;
&lt;span class=&quot;kw2&quot;&gt;find&lt;/span&gt; . &lt;span class=&quot;re5&quot;&gt;-type&lt;/span&gt; f &lt;span class=&quot;re5&quot;&gt;-not&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-path&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;./.snap/*&amp;quot;&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-exec&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;chown&lt;/span&gt; nathanpc:staff &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; \;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Fixing UNIX Permissions&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;fixing_unix_permissions&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-999&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;common_conventions&quot;&gt;Common Conventions&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
It&amp;#039;s important that if you&amp;#039;re going to be creating any NFS shares to maintain a consistent set of permissions to ensure the biggest platform compatibility possible. In order to do this make sure that the user&amp;#039;s default group in the server is set to &lt;code&gt;staff&lt;/code&gt; (GID &lt;code&gt;20&lt;/code&gt;), since this will always work on all of the BSDs, macOS, and most likely most Linux distributions.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Common Conventions&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;common_conventions&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;1000-&amp;quot;} --&gt;</description>
    </item>
</rdf:RDF>
