Friday, November 8, 2024

terminal – How did my hostname change? The place can I see this modification being made/what time it modified?

right this moment I logged into my mac and opened zsh and had a giant shock!

Usually my terminal immediate is one thing like:

sidharthghoshal@macbook-pro

However right this moment I discovered it was :

sidharthghoshal@HaeLims-Air

I do not know what HaeLims-Air is and my first assumption is I had been hacked. Exploring a bit I got here throughout this put up: How do I cease my pc title from routinely, and incorrectly, altering? .

Impressed by it I went to the terminal and ran print -P '%m' and it printed out HaeLims-Air so it my hostname %m has legitimately modified.

enter image description here

Now once I examine my system preferences and sharing the title of the macbook remains to be the identical because it has ever been. It’s Sidharth’s MacBook Professional which is what I assumed it must be.

enter image description here

So now I wish to ask. How can I discover out

  1. which recordsdata really include the string HaeLims-Air that has modified.
  2. When did this file change?

I wish to perceive precisely when that hostname within the zsh would have been modified. Since that is the primary time in my total life I’ve encountered this and nonetheless really feel fairly uneasy.

In a weak try I attempted to run grep -iR "HaeLim" . from the and many others folder however nothing got here up.

It’s doable that is benign. I regarded up my hostname historical past and certainly there I see that solely MOST lately did the host title change:


sidharthghoshal@HaeLims-Air ~ % log present --style syslog --info --last 30d | grep 'setting hostname' 

2024-01-28 16:34:51.391348-0500  localhost configd[82]: [com.apple.SystemConfiguration:IPMonitor] setting hostname to "Sidharths-MacBook-Professional.native"
2024-01-28 16:34:54.493552-0500  localhost configd[82]: [com.apple.SystemConfiguration:IPMonitor] setting hostname to "Sidharths-MBP.lan"
2024-01-28 17:39:07.272782-0500  localhost configd[82]: [com.apple.SystemConfiguration:IPMonitor] setting hostname to "Sidharths-MacBook-Professional.native"
2024-01-28 17:39:09.392589-0500  localhost configd[82]: [com.apple.SystemConfiguration:IPMonitor] setting hostname to "Sidharths-MBP.lan"
2024-01-31 11:10:27.564345-0500  localhost configd[82]: [com.apple.SystemConfiguration:IPMonitor] setting hostname to "Sidharths-MacBook-Professional.native"
2024-01-31 11:10:37.515435-0500  localhost configd[82]: [com.apple.SystemConfiguration:IPMonitor] setting hostname to "Sidharths-MBP.lan"
1969-12-31 19:06:20.379707-0500  localhost configd[82]: [com.apple.SystemConfiguration:IPMonitor] setting hostname to "Sidharths-MacBook-Professional.native"
2024-02-02 19:00:06.481011-0800  localhost configd[82]: [com.apple.SystemConfiguration:IPMonitor] setting hostname to "Sidharths-MBP.attlocal.internet"
2024-02-02 19:06:23.604979-0800  localhost configd[82]: [com.apple.SystemConfiguration:IPMonitor] setting hostname to "Sidharths-MacBook-Professional.native"
2024-02-02 19:06:27.296765-0800  localhost configd[82]: [com.apple.SystemConfiguration:IPMonitor] setting hostname to "Sidharths-MBP.attlocal.internet"
1969-12-31 20:03:50.582148-0800  localhost configd[82]: [com.apple.SystemConfiguration:IPMonitor] setting hostname to "Sidharths-MacBook-Professional.native"
2024-02-06 15:50:00.336584-0800  localhost configd[82]: [com.apple.SystemConfiguration:IPMonitor] setting hostname to "Sidharths-MBP.attlocal.internet"
1969-12-31 16:08:31.806416-0800  localhost configd[82]: [com.apple.SystemConfiguration:IPMonitor] setting hostname to "Sidharths-MacBook-Professional.native"
2024-02-06 22:00:14.072212-0800  localhost configd[82]: [com.apple.SystemConfiguration:IPMonitor] setting hostname to "HaeLims-Air"

I think that the February 06 entry given as

2024-02-06 22:00:14.072212-0800 localhost configd[82]: [com.apple.SystemConfiguration:IPMonitor] setting hostname to "HaeLims-Air"

Truly comes from my Macbook not being turned on since February 06. And thus when it turned on, earlier than the Macbook KNEW what the right date was it already was making an attempt to set the hostname. This makes numerous sense as a result of till the Macbook connects to WIFI I don’t consider it has any approach of being conscious of what the time is. So as to connet to WIFI it’ll get a hostname assigned.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles