OSX系统Safari自动重启及CoinHive恶意软件侵扰问题求助
Hey there, let's work through these two frustrating issues one by one—first we'll eliminate the CoinHive malware, then fix Safari's annoying auto-restart behavior. I've helped dozens of users sort out similar macOS/Safari problems, so let's get started:
CoinHive is a crypto-mining malware that often hijacks browsers to run in the background, which is probably why Safari won't stay closed. Here's how to wipe it out:
- Clear Safari's malicious website data
Open Safari, go to the top menu bar >Safari>Settings(or Preferences). Switch to the Privacy tab, click Manage Website Data. Use the search bar to look for "CoinHive" or any suspicious domain names you don't recognize. Select them and click Remove, then hit Done. You can also click Remove All to clear all cached data (just make sure you don't mind losing saved site preferences). - Delete sketchy Safari extensions
Still in Safari Settings, switch to the Extensions tab. Scan the list for any extensions you didn't install, or ones that sound related to mining, ads, or "optimization" (malware often hides behind these labels). Click the extension name, then hit Uninstall. - Force kill rogue processes via Terminal
Open Launchpad > Other > Terminal. First, runps aux | grep coinhiveto find any running CoinHive-related processes. Note the PID (the number in the second column) for each suspicious entry, then runkill -9 [PID](replace [PID] with the actual number) to force it to stop. If Safari is stuck open, runkillall Safarito shut it down completely. - Block malware from launching on startup
Open System Settings > General > Login Items. Look for any unfamiliar apps or processes here—especially ones with names you don't recognize or that mention mining. Click the "–" button to remove them from the list, so they don't fire up automatically when you boot your Mac.
Once the malware is gone, let's make sure Safari stops restarting on its own:
- Turn off Safari's auto-restore feature
Go back to Safari Settings > General. Uncheck the box next to "Restore windows when quitting and re-opening Safari". This prevents Safari from reloading all your previous tabs (including any malicious ones) every time you launch it. - Reset Safari to default settings
If the auto-restart persists, a full reset might help. First, backup your bookmarks (File > Export Bookmarks) just in case. Then open Terminal and run:
Quit and restart Safari—this will wipe all extensions, cached data, and custom settings, returning Safari to its out-of-the-box state.defaults write com.apple.Safari ResetSafari -bool true - Update macOS and Safari
Outdated software can have bugs that cause weird behavior. Open System Settings > General > Software Update. Install any available macOS updates, which will also update Safari to the latest version with security fixes.
If you follow all these steps, both the CoinHive malware and Safari's auto-restart issue should be resolved. If you still hit snags, drop a comment with more details (like error messages or specific behavior) and I'll help you troubleshoot further!
内容的提问来源于stack exchange,提问作者宋大哥

