
Security Byte: Rabbit Hole (pt. 2) with a neat, lesser known terminal command
evertrendzone security byte exclusively brings you Mosyle, the only Apple integrated platform. Simply work your Apple device and create an enterprise safe. Our unique integrated approach to management and security combines fully automated hardening and compliance, next-generation EDR, AI-powered Zero Trust, and cutting-edge Apple-specific security solutions for exclusive privilege management with the most powerful and modern Apple MDM on the market. As a result, the fully automated Apple Unified platform, currently trusted by over 45,000 organizations, can make millions of Apple devices function at an affordable cost. Request an extension test Understand why Mosil is everything you need to work with Apple today.
I recently fell into a rabbit hole with a lesser known terminal function. Over the past few months I’ve covered everything from enabling Touch ID for SUDO authentication to cleaning up public Wi-Fi connections stored on my Mac. But this week I would like to share more neat features you probably didn’t know that a terminal could be. These are useful if you are a daily Mac user or manage your enterprise fleet. In this edition of Security part-time jobsit can further improve your command line skills.
more: Decent, lesser known terminal command rabbit hole down (pt. 1)
Not all the commands below explicitly focus on security, but they can work smarter, improve efficiency and show off some truly useful tricks. Being skilled in a terminal helps you think like a system, and thinking like a system is the first step to ensuring it.
Password protection for compressed folders

A .dmg (disk image) file is like a thumb drive in software format. It is used on MacOS to package and distribute applications, files, and even malware. However, it can also be used to store and transmit sensitive or sensitive information. Last week I learned from a friend (Hey Charlie) that I can compress folders into .DMG files using AES-128 encryption from within the terminal. This is the same standard used by governments today. Anyone receiving the .dmg file requires a password to decrypt and open it. Here’s how:
beginning cd
I want to compress it into a directory containing folders. For simplicity, I use the desktop in the example below:
Now, type:
hdiutil create -encryption -stdinpass -srcfolder ~/Desktop -volname "(Name of the folder as seen in directory)" -format UDZO ~/Desktop/(Name your compressed file).dmg
Certainly, this can also be done from within the Disk Utility GUI. If you’re having trouble doing that in the terminal, try this.
- open Disk Utility application
- I’m going File ->New Image
- click Images from folder
- Select the folder you want to compress and protect
- Name the .dmg file and choose its location and encryption standard (AES 128 or 256).
enjoy!
Side note: Do not use zip -er
Password protected for compressed folders. I’ve seen an example of this online. This uses the current Zipcrypto encryption standard. This can be decrypted in minutes using a variety of free tools. It’s not safe.
Quickly check and update your software

We all know how to manually update to the latest MacOS version with settings, but you can use terminal to perform faster and a little extra benefits.
type:
softwareupdate -l
This will list all available updates on your Mac (excluding App Store apps). You can download and install a specific file using the following command:
softwareupdate -i "
(Title)
“
You can also download and install all updates into one dive using:
softwareupdate -i -a
Press Enter and you are golden!
Automatically check and update more frequently

By default, Apple already has automatic update checking enabled, but the default check frequency is once every 7 days. You can use the terminal to order your Mac to check for software updates and notify you frequently (or less) frequently. For example, here’s how to run a daily check:
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
sudo softwareupdate --schedule on
The end interval for the first command is the number of days between checks. For example, if you change to 3, you will be checked for updates every 3 days. The second command is basically to say to our machine “Hey, follow the schedule I actually gave you.”
If you’re not worried about a newer version of MacOS breaking the tool, you can also set it up to automatically install the new and available updates listed above.
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool true
This command allows you to install MACOS updates that require a restart:
sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -bool true
Clear the DNS cache
When you load a website, MacOS stores the IP address in the local DNS cache. This behind-the-scenes database will allow Safari and other browsers to resolve domain names faster, requiring a full DNS search every time you visit.
Although rare, the cache can sometimes become obsolete or bloated over time, leading to issues like slow page loads and errors such as “DNS server not responding”. MacOS automatically flushes out the DNS cache from time to time, but you can manually force a refresh after troubleshooting connection issues or changing your DNS settings.
To manually flush the DNS cache, enter the following commands in order:
sudo killall -HUP mDNSResponder
(A password is required))sudo killall mDNSResponderHelper
sudo dscacheutil -flushcache
Create an ASCII art banner
Finally, for fun, the terminal can also be an ASCII art banner. type:
banner -w 40 9to5Mac
Feel free to replace evertrendzone with your favorite words or phrases. You can also mess with numbers related to the width of the banner.

If you find any of these useful, please comment below. Do I need to add pt.3?
fIn Ollow: Twitter/xLinkedIn, Thread
(TagStoTRASSLATE) Security Byte (T) terminal