Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Blocking websites on Linux: the options, and what each can't do

说明与用途

作者评估了Linux网站阻止方法的局限性,并创建了glocker,该工具在计划时间段内禁用sudo并需要输入挑战来卸载,从而提供更强的阻止效果。

问题

The author needed a reliable way to block websites and apps on Linux that could not be easily undone by the user.

结果

glocker provides a more robust blocking solution by disabling sudo during scheduled hours, making uninstallation difficult, and offering accountability notifications, addressing gaps in other methods.

工作流

  • 1. Identify the sites/apps to block.
  • 2. Choose a blocking method: /etc/hosts, DNS filter, browser extension, blocker app, or glocker.
  • 3. Configure the chosen tool (e.g., add hosts entries, set DNS filter, install extension, or install glocker).
  • 4. For glocker, set schedule, disable sudo during blocked hours, and configure optional dashboard for accountability.
  • 5. Verify blocking works and that sudo is disabled during scheduled hours.
  • 6. Monitor for gaps (e.g., DNS-over-HTTPS, other browsers, second devices).

证据

I made the file immutable with chattr +i /etc/hosts. After that, even root can't edit it without first running chattr -i.

来源

A filter only works while traffic goes through it, though. On a laptop, changing the DNS server, or connecting from somewhere else, gets around it.

来源

It only covers the browser it's installed in. An incognito window, another browser, another profile, or two clicks in the add-ons menu, and the blocks are gone.

来源

The gap they all share is root. If you can run sudo, you can stop the service, edit the files or uninstall the app, so any of them can be undone in a minute when you really want to.

来源

It takes away my sudo during the hours I choose, so I can't stop the service, edit the hosts file or uninstall it.

来源

Uninstalling is slow on purpose. I have to type a sentence that's revealed one character at a time, and start again if I slip.

来源

  • 记录日期: 2026-11-01T15:13:44.225Z