Monday, 9 January 2017

Ubuntu Proxy Settings

Setting up Network, Proxy Settings in & its process in Background - IITG


 Shortcut 


                         For IIT G proxy settings there is a script made to automate the all the proxy Settings required, but I strongly recommend not to follow this automated script for the first time you do it, as you will not get to know behind the scenes of the script. So those who say "now stop talking and give me the link 😜 " Open Roopansh Bansal-Proxy Switch , read the readme and proceed with the script.

Note: This will just add proxy settings before that you need to configure LAN if you are using one. Kindly, follow 1st step in that case and then use the script.


The Actual Process




 1. IP Address:


                           For LAN first make sure that you have set up IPV4 settings by setting your  Room IP, Subnet Mask and Gateway in it.

   By System Settings → Network → Wired → Options → IPv4 Settings

Mind that the method is Manual. Finally save the settings and close the tab.



 2. Proxy in Network Settings:


   Then open the Network Proxy and set your proxy and port and click 'Apply System Wide'

   By System Settings → Network → Network Proxy



 Background: 
                       This creates the proxy configurations files required for app store and other  purposes in the apt.conf & environment files stated in the below steps, but what it doesn't know is  your Proxy Authentication (User name & Password). Unlike the browser app store does not  ask for Authentication every time you open it, so you need to set it up priorly in the  respective files.


 3. Proxy in apt.conf file:

  
                                            Open your Terminal (Ctrl+T) and type the below command.
$ sudo gedit /etc/apt/apt.conf
 This will open the apt.conf file in gedit(editor). 

 Now edit the file in the below format:
Acquire::http::proxy "http://<username>:<password>@<proxy>:<port>/";
Acquire::https::proxy "https://<username>:<password>@<proxy>:<port>/";
Acquire::ftp::proxy "ftp://<username>:<password>@<proxy>:<port>";
Acquire::socks::proxy "socks://<username>:<password>@<proxy>:<port>";
 and replace the contents in this tag <....> with that of your credentials similar to that of the  figure shown below.



  Note: Ignore if there appears some Gtk warnings in the terminal.

  Background: 
                        This Proxy Authentication settings are for App Store. You can use these things even with the "apt-get" command. Try "$ sudo apt-get update" to test the above settings.



4. Proxy in environment & bashrc file:


                                      Similarly now open the environment file using the below command.
$ sudo gedit /etc/environment
 and edit the file in the below format and replace the contents in this tag <....> with that of  your credentials.
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
http_proxy="http://<username>:<password>@<proxy>:<port>/"
https_proxy="https://<username>:<password>@<proxy>:<port>/"
ftp_proxy="ftp://<username>:<password>@<proxy>:<port>/"
socks_proxy="socks://<username>:<password>@<proxy>:<port>/"
 Similarly do the same for the .bashrc file (. means hidden) using the command
$ sudo gedit ~/.bashrc
 note: ~/ means home directory and / means root directory

 and add the below content in the top or below of the file and replace the contents in this tag <....> with that of  your credentials. 

export http_proxy="http://<usenme>:<password>@<proxy>:<port>/"
export https_proxy="https://<usenme>:<password>@<proxy>:<port>/"
export ftp_proxy="ftp://<usenme>:<password>@<proxy>:<port>/"
export socks_proxy="socks://<usenme>:<password>@<proxy>:<port>/"
no_proxy="localhost,127.0.0.0/8,*iitg.ernet.in,202.141.*"
 note: no_proxy contains all the url's for which proxy is not required.

 Background: 
                        These two things will allow the terminal to tunnel to connect to the inetrnet. For example the command wget (to download things from internted by its url) will now be able to download stuff. 
Try "$ wget http://en.wikipedia.org/wiki/Ubuntu_(operating_system)" to test the above settings.

7 comments:

  1. even if you opt for the script, you would still have to do the settings for the LAN (i.e. step-1 of the procedure above). the script doesn't do that.

    ReplyDelete
  2. Hi.please tell me if you have installed ubuntu in vmware, then how to set network. Iam able to access all intranet sites and intranet sites in browser,however, i am not able to update and neither install any new software. I have configured apt.conf and followed all steps. I think so it is related to settings which initially is to be done while installing linus in VMWARE. If you are aware please tell us.

    ReplyDelete
  3. bons casino【阅读全文】⚡️ 日利奖
    bons fun88 vin casino【阅读全文】⚡️ 메리트카지노 日利奖【阅读全文】⚡️ 日利奖【阅读全文】⚡️ 日利奖【阅读全文】⚡️ ボンズ カジノ

    ReplyDelete
  4. Casino Lake Tahoe - MapYRO
    Casino Lake Tahoe. Stateline. Directions to 원주 출장샵 Casino Lake Tahoe. 서울특별 출장안마 A large, circular 여주 출장마사지 swimming 밀양 출장안마 pool. Open 김해 출장샵 24 hours a day. Casino Lake Tahoe.

    ReplyDelete