How to set proxy over the corporate network?

How to set proxy over the corporate network?

For working in corporate network you need to get through the proxy network for downloading files which is under your project requirement. So in this post ,you will learn setting proxy over several file so that working in system become easier.First you must have to where the changes has be done mean which files used for proxy authetication so there are several list of file in which you have set the proxy: 

1) .bashrc 
2) /etc/environment(for only cent OS or Red Hat based OS) in case of another OS(like Ubuntu) try to search for /etc/profie.d
3).bash.bashrc (if exists)

Steps to set proxy :

1. Open your terminal check already proxy are set or not first by typing this command:

 echo $http_proxy                                                                                                                                  

  Note: you need to check for several variable like same:
       
    $https_proxy,$HTTP_PROXY,$HTTPS_PROXY                                                                             

2. If there is alredy  set proxy you need to unset by hiting below command:
    
   unset $http_proxy                                                                                                                              

 Same for another variables also as same:  
                   
 unset  $https_proxy  $HTTP_PROXY  $HTTPS_PROXY

     Then check     echo $http_proxy

3. After unsetting proxy use below command for setting proxy inside .bashrc file ,and make sure   <usename>  and <password> must be correct ,and escape special character like @, #.
 This must be replace by following UTF code-
          
                  @          %40
                   #          %23
                   $          %24
                   !           %21
                   :           %3A

Example: A@B:C!D#EF$   should be change into  A%40B%3AC%21D%23EF%24
assign this string to one variable:
                  
 $PROXY  =  http://<username>:<password>@proxy_server:port 
         
Then assign this to variable one by one -
         
    $http_proxy =  http://<username<password>@proxy_server:port 
    $https_proxy =  http://<username<password>@proxy_server:port
    $HTTPS_PROXY=  http://<username<password>@proxy_server:port 
    $HTTPS_PROXY =  http://<username<password>@proxy_server:port 

This action must be perform in terminal.then hit this below commands: 

       export $http_proxy
       export $https_proxy
       export $HTTPS_PROXY
       export $HTTPS_PROXY      


Direct method:

    
 vim  ~/.bashrc                                                                                                                                        
        or 
 gedit ~/.bashrc                                                                                                                                       

paste these into .bashrc for cent OS inside /etc/environment 

 PROXY  =  http://<username<password>@proxy_server:port 
 http_proxy=  $PROXY  
 https_proxy=  $PROXY  
 HTTP_PROXY=  $PROXY  
 HTTPS_PROXY=  $PROXY  
                                                  

4. After activate this changes by hiting this commad iin terminal
            
    source  ~/.bashrc 
    source    /etc/environment           #(for cent os)

These are several steps to set the proxy, in next post you will get how to set the proxy in git ,pip and yum,wget.


Comments