Locking your computer's USB port can be accomplished in a number of ways,depending on your operating system and needs. Here are some common methods:
For Windows operating system
1.Use Device Manager
-Open Device Manager.
-Expand the Universal Serial Bus Controllers list.
Right-click on each USB controller and select“Disable Device”.This will disable all USB ports.
2.Using Group Policy Editor (for Professional,Enterprise and Education editions)
-Press`Win + R`to open the Run dialog box,type `gpedit.msc`and enter.
-Navigate to`Computer Configuration`->`Administrative Templates`->`System`->`Removable Storage Access`. “.Locate and double-click on“All removable storage:Deny all permissions”in the right pane and select“Enabled”.
3.Use Registry Editor
-Press`Win + R` to open the Run dialog box,type`regedit`and enter.
-Navigate to`HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor`.
-Create a new DWORD value named“Start”and set its value to 4.This will prevent the USB storage device from being recognized.

For MacOS operating systems
MacOS does not have a direct GUI option to completely disable USB ports,but you can restrict access to USB devices through third-party software or through Terminal commands.
1.Using Terminal Commands
There are command line tools that can be used to control USB devices,but this usually requires some technical knowledge and it may not always be possible to completely disable USB ports.
2.Third-party software
There are third-party applications that can provide finer-grained control,such as restricting specific types of USB device connections.

Physical methods
If the above methods don't work for you,you can also consider physically disabling the USB port.This usually involves opening the computer case and physically disconnecting the USB port from the motherboard,or using a USB port cover to conceal the port.
Please choose the appropriate method for your specific needs and operating system version.Before making any changes,make sure you back up your important data and understand the possible consequences of each step of the procedure.If you are not sure how to proceed,it is recommended to seek professional help.
