Plz do abide to our Terms & Condition:

    • Do not paste URL Links directly in any content instead post them as Hyperlink inside a text.
       
    • To post a Link directly use instead Bookmark.
       
    • If we find anyone posting beyond the warning we will immediately terminate your account without any warning. 

Set Proxy Settings on linux Console / Terminal to get Internet Access

http://www.nextstep4it.com/categories/how-to/proxy-settings/

Overview :

 

In Linux Like operating system ,  we have the variables  likehttp_proxy,ftp_proxy and https_proxy  through which we can access the Internet via proxy on linux console.

 

All of the above mentioned variables are can be used with tools like elinks , wget , lynx , rsync  and others.

 

I am assuming Linux servers are behind the proxy servers and can get the Internet connection only via proxy settings.

 

 

Proxy Setting commands on Linux  Console :

 

Example:1 Access http base sites via proxy , use below variable

 

# export http_proxy=http://<proxy-server-ip-or-dns-name>:<Port-Number&gt;

 

# export http_proxy=http://proxy.nextstep4it.com:8080

 

Example:2 Password Protect Proxy Settings

 

# export http_proxy=http://USERNAME:PASSWORD@<proxy-server-ip-or-dns-name>:PORT

 

# export http_proxy=http://nsit:*****@proxy.nextstep4it.com:8080/

 

Using Above  Command we have set the proxy setting along with user name and password.

 

Example:3 To access secure sites(https) via proxy , set below variable

 

#  export https_proxy=http://<proxy-server-ip-or-dns-name>:<Port-Number&gt;

 

# export https_proxy=http://proxy.nextstep4it.com:8080/

 

Example:4 To access ftp based sites via Proxy , set the below variable

 

# export ftp_proxy=http://<proxy-server-ip-or-dns-name>:<Port-Number&gt;

 

# export ftp_proxy=http://proxy.nextstep4it.com:8080/

 

Note : As these variables are declared for the particular session , to set it permanently , define these variables in the file “/etc/bash.bashrc”

 

export http_proxy=http://proxy.nextstep4it.com:8080/
export ftp_proxy=http://proxy.nextstep4it.com:8080/
https_proxy=http://proxy.nextstep4it.com:8080/

 

Example:5   Proxy Settings in APT  on Ubuntu Linux

 

# Vi /etc/apt/apt.conf

Acquire::http::Proxy "http://<proxy-server-ip-or-dns-name>:<Port-Number&gt;";

 

Example:6  Proxy Settings for RSYNC

 

# export RSYNC_PROXY="http://<proxy-server-ip-or-dns-name>:<Port-Number>&rdquo;

 

# export RSYNC_PROXY="http://proxy.nextstep4it.com:8080&rdquo;

Ratings

0/5 (0 votes)
0/5 (0 votes)