<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>linux &amp;mdash; moonwalkers-shenanigans</title>
    <link>https://moonwalkers-shenanigans.writeas.com/tag:linux</link>
    <description>feel free to follow my shenanigans on this blog I guess. mastodon: @moonwalker@infosec.exchange</description>
    <pubDate>Sun, 17 May 2026 04:20:28 +0000</pubDate>
    <item>
      <title>The quest of generating a new machine id on boot.</title>
      <link>https://moonwalkers-shenanigans.writeas.com/the-quest-of-generating-a-new-machine-id-on-boot?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[The quest of generating a new machine id on boot.&#xA;So I&#39;m back to doing some weird-ass shit. This time my target was the machine id on linux. I mean it&#39;s an id, which can potentially identify your machine right? I&#39;m probably wrong here. But what if your machine id was never permanent... Now that&#39;s interesting.&#xA;&#xA;First of all, how do you find the machine id file? It&#39;s not like linux is gonna store that in registry or something, do you think this os is windows like? Think again! I guess you can find a path to the machine id file with a find command or just by searching with your favourite search engine.&#xA;Looks like there are 2 paths to the machine id file: /var/lib/dbus/machine-id and /etc/machine-id, and if we want to generate a new machine id, we will need to delete both of them.&#xA;&#xA;Now for generating a new id it&#39;s simple: you can use a dbus-uuidgen command with a --ensure option, in order to make sure it&#39;s not regenerating the id if the file already exists.&#xA;&#xA;My final script looks like this:&#xA;rm /etc/machine-id&#xA;rm -v /var/lib/dbus/machine-id&#xA;dbus-uuidgen --ensure=/etc/machine-id&#xA;dbus-uuidgen --ensure&#xA;&#xA;if you want to run this on startup, you will need to get a bit creative and write a systemd service(if you&#39;re on systemd). Since I know that not everyone uses systemd I&#39;m not posting the contents of the systemd service file here. feel free to let me know if I should post the systemd service file or host this on gitlab or something.&#xA;&#xA;#privacy #linux]]&gt;</description>
      <content:encoded><![CDATA[<p>The quest of generating a new machine id on boot.
So I&#39;m back to doing some weird-ass shit. This time my target was the machine id on linux. I mean it&#39;s an id, which can potentially identify your machine right? I&#39;m probably wrong here. But what if your machine id was never permanent... Now that&#39;s interesting.</p>

<p>First of all, how do you find the machine id file? It&#39;s not like linux is gonna store that in registry or something, do you think this os is windows like? Think again! I guess you can find a path to the machine id file with a find command or just by searching with your favourite search engine.
Looks like there are 2 paths to the machine id file: /var/lib/dbus/machine-id and /etc/machine-id, and if we want to generate a new machine id, we will need to delete both of them.</p>

<p>Now for generating a new id it&#39;s simple: you can use a dbus-uuidgen command with a —ensure option, in order to make sure it&#39;s not regenerating the id if the file already exists.</p>

<p>My final script looks like this:
rm /etc/machine-id
rm -v /var/lib/dbus/machine-id
dbus-uuidgen —ensure=/etc/machine-id
dbus-uuidgen —ensure</p>

<p>if you want to run this on startup, you will need to get a bit creative and write a systemd service(if you&#39;re on systemd). Since I know that not everyone uses systemd I&#39;m not posting the contents of the systemd service file here. feel free to let me know if I should post the systemd service file or host this on gitlab or something.</p>

<p><a href="https://moonwalkers-shenanigans.writeas.com/tag:privacy" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">privacy</span></a> <a href="https://moonwalkers-shenanigans.writeas.com/tag:linux" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">linux</span></a></p>
]]></content:encoded>
      <guid>https://moonwalkers-shenanigans.writeas.com/the-quest-of-generating-a-new-machine-id-on-boot</guid>
      <pubDate>Fri, 17 Nov 2023 22:42:27 +0000</pubDate>
    </item>
  </channel>
</rss>