Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to modify proxy settings in Linux CentOS

Posted on 2014-11-07
9
Medium Priority
?
600 Views
Last Modified: 2014-11-12
Hello,

As I am getting more familiar with Linux, I am wondering how to add a proxy setting to my centos server.

In windows I am used to going to my "Internet Options" -> "Connections" -> "LAN Settings" -> make changes in here.... proxy address & port

How would I perform this on my centos box?

thx
t
0
Comment
Question by:tobe1424
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 23

Accepted Solution

by:
savone earned 2000 total points
ID: 40429554
On linux the proxy settings are set per app.  You can set the proxy setting in firefox for regular browsing.

For more information see here:
http://www.putorius.net/2012/06/how-to-configure-system-proxy-settings.html
0
 
LVL 62

Expert Comment

by:gheist
ID: 40430014
You can set proxy using environment variables:
https://wiki.archlinux.org/index.php/proxy_settings

Some programs take only http_proxy. some need username in different environment variable, some has selectable option to actually use system variables, but still say with 'export all_proxy=http://me:secure@proxy.corp:12345/' all scripting languages will use that proxy.
Graphical browsers with javascript interpreter can use PAC or WPAD, but no others can do that
0
 

Author Comment

by:tobe1424
ID: 40432805
The reason I asked about the proxy setting is because I was running an "apt-get" command to download a package and I receive errors. On my windows vm I added the proxy settings easily. However, using linux cli, I am not where exactly to specify the proxy
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 23

Expert Comment

by:savone
ID: 40432825
Enter the following command:

http_proxy=http://192.168.1.1:8080

Replace 192.168.1.1:8080 with your proxy IP address and port.

Once you enter the command try your apt-get command again.
0
 

Author Comment

by:tobe1424
ID: 40437601
Thanks for the feedback.

I cannot find "proxy.sh" inside /etc/profile.d/

nor can I find it in the system.

Is this something that needs to be installed?
0
 
LVL 62

Expert Comment

by:gheist
ID: 40437614
You need to create executable file called proxy.sh that exports all variables.
YUM will ignore that.
0
 

Author Comment

by:tobe1424
ID: 40438023
Would this be a valid example of the shell script?

export http_proxy=http://10.203.0.1:5187/
 export https_proxy=$http_proxy
 export ftp_proxy=$http_proxy
 export rsync_proxy=$http_proxy
 export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
0
 
LVL 62

Expert Comment

by:gheist
ID: 40438346
Why it should be an example? Yes, you posted valid list of shell commands.
0
 

Author Closing Comment

by:tobe1424
ID: 40438662
edited the yum.conf file

# The proxy server - proxy server:port number
proxy=http://mycache.mydomain.com:3128
# The account details for yum connections
proxy_username=yum-user
proxy_password=qwerty
0

Featured Post

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question