©2015 - 2022 Chad’s Technoworks. Disclaimer and Terms of Use

Chad’s TechnoWorks My Journal On Technology

Information Technology

MacOS Command Line Quick Reference

TABLE OF CONTENTS


How To Verify MD5 and SHA256 Checksum

How To Disable / Enable MacOS SIP (System Integrity Protection)

How To Disable / Enable Gate Keeper

MacOS System Profile Check



VERIFY MD5 CHECKSUM

You can either use the md5 command or the openssl.


Sample output:


chad@MM18 Downloads % md5 python-3.8.8-macosx10.9.pkg

MD5 (python-3.8.8-macosx10.9.pkg) = 3b039200febdd1fa54a8d724dee732bc

chad@MM18 Downloads %


chad@MM18 Downloads % openssl md5 python-3.8.8-macosx10.9.pkg

MD5(python-3.8.8-macosx10.9.pkg)= 3b039200febdd1fa54a8d724dee732bc

chad@MM18 Downloads %



VERIFY SHA256 CHECKSUM

You can either use shasum or openssl command.


chad@MM18 Downloads % shasum -a 256 Fedora-Server-dvd-x86_64-29-1.2.iso

129d131a55e5bd518f593f0eacdce095f7c795fe7ccbef1f3f6aeb2ff9f99f35  Fedora-Server-dvd-x86_64-29-1.2.iso

chad@MM18 Downloads %


chad@MM18 Downloads % openssl SHA256 ./Fedora-Server-dvd-x86_64-29-1.2.iso

SHA256(./Fedora-Server-dvd-x86_64-29-1.2.iso)= 129d131a55e5bd518f593f0eacdce095f7c795fe7ccbef1f3f6aeb2ff9f99f35

chad@MM18 Downloads %



DISABLE / ENABLE MAC OS SIP


System Integrity Protection (SIP)

This is a security feature built into the MacOS since version 10.11 (El Capitan) that prevents users to install packages or modify any system files into the following directories.

/System

/sbin

/bin

/usr (with the exception of /usr/local subdirectory)


In addition, it also protects the removal or altering the Apps that comes with the MacOS (Terminal, Safari) found in the /Applications folder.


You can check the list of protected files at /System/Library/Sandbox/rootless.conf


WARNING: You shouldn't be disabling the SIP unless you fully trust the application that tries to modify the system.


TO DISABLE SIP

1. Shutdown Mac computer.

2. Power on your Mac computer and hold down Command + R keys simultaneously after you hear the startup chime.

   This will boot Mac OS X into Recovery Mode.

3. When the “MacOS Utilities” / “OS X Utilities” screen appears, open the Terminal console from the utilities Menu.

4. Verify the current SIP config by typing the command: csrutil status


sample output -


#  csrutil status

System Integrity Protection status: enabled.

#


5. To disable SIP, type the following command into the terminal:

csrutil disable; reboot


TO RE-ENABLE SIP

Follow previous steps 1 to 4 to enter in recovery mode.

Then from the terminal console, type:


csrutil enable; reboot


Further details of csrutil parameters -

usage: csrutil <command>

Modify the System Integrity Protection configuration. All configuration changes apply to the entire machine.

Available commands:


    clear

        Clear the existing configuration.

    disable

        Disable the protection on the machine. Only available in Recovery OS.

    enable

        Enable the protection on the machine. Only available in Recovery OS.

    status

        Display the current configuration.


    netboot

        add <address>

            Insert a new IPv4 address in the list of allowed NetBoot sources.

        list

            Print the list of allowed NetBoot sources.

        remove <address>

            Remove an IPv4 address from the list of allowed NetBoot sources.


MACOS GATE KEEPER DISABLE / ENABLE


Gate Keeper is another layer of security in a Mac OS.

It prevents the installation of an unsigned App or unidentified Apple developer.

The prevention is normally applied on apps downloaded from a website and is not part of the App Store offering.


If you trust the downloaded app, you may temporarily disable the Gatekeeper to allow the installation of unsigned app.


TO VERIFY GATEKEEPER CURRENT STATUS


sudo spctl --status


TO DISABLE GATEKEEPER


sudo spctl --master-disable


TO ENABLE GATEKEEPER


sudo spctl --master-enable


MACOS SYSTEM PROFILE CHECK


The following commandline version is equivalent to the GUI presentation of System Report of “About This Mac”.


chad@CTW-MM18 ~ % system_profiler -listDataTypes

Available Datatypes:

SPParallelATADataType

SPUniversalAccessDataType

SPSecureElementDataType

SPApplicationsDataType

SPAudioDataType

SPBluetoothDataType

SPCameraDataType

SPCardReaderDataType

SPiBridgeDataType

SPDeveloperToolsDataType

SPDiagnosticsDataType

SPDisabledSoftwareDataType

SPDiscBurningDataType

SPEthernetDataType

SPExtensionsDataType

SPFibreChannelDataType

SPFireWireDataType

SPFirewallDataType

SPFontsDataType

SPFrameworksDataType

SPDisplaysDataType

SPHardwareDataType

SPInstallHistoryDataType

SPInternationalDataType

SPLegacySoftwareDataType

SPNetworkLocationDataType

SPLogsDataType

SPManagedClientDataType

SPMemoryDataType

SPNVMeDataType

SPNetworkDataType

SPPCIDataType

SPParallelSCSIDataType

SPPowerDataType

SPPrefPaneDataType

SPPrintersSoftwareDataType

SPPrintersDataType

SPConfigurationProfileDataType

SPRawCameraDataType

SPSASDataType

SPSerialATADataType

SPSPIDataType

SPSmartCardsDataType

SPSoftwareDataType

SPStartupItemDataType

SPStorageDataType

SPSyncServicesDataType

SPThunderboltDataType

SPUSBDataType

SPNetworkVolumeDataType

SPWWANDataType

SPAirPortDataType

chad@CTW-MM18 ~ %    

chad@CTW-MM18 ~ %

chad@CTW-MM18 ~ % system_profiler SPThunderboltDataType | grep -E 'Thunderbolt Bus'

    Thunderbolt Bus 1:

    Thunderbolt Bus 0:

chad@CTW-MM18 ~ % system_profiler SPThunderboltDataType                            

Thunderbolt:


    Thunderbolt Bus 1:


      Vendor Name: Apple Inc.

      Device Name: Mac mini

      UID: 0x00012D5B6020EC01

      Route String: 0

      Firmware Version: 47.4

      Domain UUID: 4899344A-BE64-B05C-9AC7-2EBE8E0E57F5

      Port:

          Status: No device connected

          Link Status: 0x101

          Speed: Up to 40 Gb/s x1

          Current Link Width: 0x1

          Receptacle: 4

          Link Controller Firmware Version: 1.34.0

      Port:

          Status: No device connected

          Link Status: 0x101

          Speed: Up to 40 Gb/s x1

          Current Link Width: 0x1

          Receptacle: 3

          Link Controller Firmware Version: 1.34.0


    Thunderbolt Bus 0:


      Vendor Name: Apple Inc.

      Device Name: Mac mini

      UID: 0x00012D5B6020EC00

      Route String: 0

      Firmware Version: 47.4

      Domain UUID: 77C4F52C-BEBA-355A-B6E5-670E145FE024

      Port:

          Status: No device connected

          Link Status: 0x101

          Speed: Up to 40 Gb/s x1

          Current Link Width: 0x1

          Receptacle: 2

          Link Controller Firmware Version: 1.34.0

      Port:

          Status: No device connected

          Link Status: 0x101

          Speed: Up to 40 Gb/s x1

          Current Link Width: 0x1

          Receptacle: 1

          Link Controller Firmware Version: 1.34.0


chad@CTW-MM18 ~ %