0

friends, I am an Ubuntu 12.04 user and i want to any user can't send email from gmail in my pc, because they sending abuse mails from their gmail account but sending from my pc. So, please help me and suggest the right way.

Seth
  • 58,122
Rakesh
  • 1,159
  • 2
    Maybe your Router can block gmail (the Website, not the mails) but I think the best way is to secure your PC with a password and lock the desktop when you're not at the pc. – prophecy201 Jun 17 '13 at 11:50

1 Answers1

1

One method to prevent any access to gmail.com is to reroute it in your hosts file. This will redirect any requests to gmail.com to resolve to your local machine and not the external internet.

The method is reversible, so that you can toggle the setting when you need to use Gmail yourself.

  • Edit the file located at /etc/hosts
  • Add 2 new lines as below:

127.0.0.1 gmail.com

127.0.0.1 mail.google.com

  • Save and close the file
  • Restart the networking service by running the following in your terminal:

sudo service networking restart

If you now try to access gmail.com in your browser, you will find it does not load.

To disable this routing rule, so that you can access Gmail yourself, follow the same directions as above, but simply prefix the custom rules you added previously with a # character as below:

#127.0.0.1    gmail.com
#127.0.0.1    mail.google.com

Adding or removing the # character at the front of those lines will then enable or disable the blocking of Gmail. The same technique may be used for any other domains you want to block access to.

*help on editing your hosts file in Ubuntu and other OS's may be found here

ljs.dev
  • 1,271