Login Register






The stories and information posted here are artistic works of fiction and falsehood. Only a fool would take anything posted here as fact.
Thread Rating:
  • 0 Vote(s) - 0 Average


Tutorial Linux Automated Hostname and MAC Address Randomization filter_list
Author
Message
Linux Automated Hostname and MAC Address Randomization #1
I am using this code successfully on Ubuntu 22.04 LTS.

First, we set automatic mac randomization, then Hostname randomization. With both randomizations enabled, each time we boot up the system, we get a new hostname and WIFI mac address, appearing as a new computer to any WIFI networks we connect to.


mac randomization:

1. first, Create the file /etc/NetworkManager/conf.d/00-macrandomize.conf and edit it with sudo. Append the following into the file:



2. copy paste this code into your text editor for the macrandomize.conf file:

[device]
wifi.scan-rand-mac-address=yes

[connection]
wifi.cloned-mac-address=random
ethernet.cloned-mac-address=random
connection.stable-id=${CONNECTION}/${BOOT}


3. run this terminal command to restart network manager:

systemctl restart NetworkManager



hostname randomization:


macrandomization.sh :

#!/bin/bash

hostnamectl hostname "$(shuf -n 1 /home/USER/Desktop/Texts/hostnames1.txt)"



macrandomize.service :

[Unit]
Description=Randomize Hostname upon device bootup, before network interface starts.
Before=network-pre.target

[Service]
Type=oneshot
ExecStart=/bin/bash /usr/bin/macrandomize.sh

[Install]
WantedBy=network-pre.target



Thank you and enjoy Smile
(This post was last modified: 11-27-2023, 10:48 PM by EliteWizard42.)

Reply

RE: Linux Automated Hostname and MAC Address Randomization #2
Yo man thanks for this appreciate it.

Reply







Users browsing this thread: 1 Guest(s)