Jump to content

Setting up apt-get to use a http-proxy


wildweaselmi
 Share

Recommended Posts

Ubuntu Proxy



First edit


sudo nano /etc/apt/apt.conf



It's probably blank but if not replace with

Acquire::http::proxy "http://domain\userid:password@proxyip:port/";[/code]




Also edit

sudo nano /etc/enivornment




Add the following


export http_proxy=http://domain\userid:password@proxyip:port/

export ftp_proxy=http://domain\userid:password@proxyip:port/






Finally you may as well edit

sudo nano /etc/bash.bashrc




Add to the end


export http_proxy=http://domain\userid:password@proxyip:port/

export ftp_proxy=http://domain\userid:password@proxyip:port/


Link to comment
Share on other sites

  • 4 months later...

This has changed some with Ubuntu 12.x





Now to setup apt-get to use a proxy, the settings are now found/created below





sudo gedit /etc/apt/apt.conf.d/02proxy






Note : 01proxy file is not present and 02proxy wasn't present either.







Type the following line in the file:



Acquire::http::Proxy “http://yourusername:yourpassword@yourproxy:yourport″;[/code]


Link to comment
Share on other sites

  • 4 years later...
Guest dennis

A small issue when setting up proxy access for installing software (apt-get) or performing wget/curl operations through the proxies.

 

This typically requires you to perform an export command as shown below.

export https_proxy=http://username:password@10.60.0.19:80/

export http_proxy=http://username:password@10.60.0.19:80/

 

This command goes into your history and anyone that can access your history file or walks up to your pc when logging in and not locked to the jump box can dump your history and get your AD creds.

 

I’ve been killing my entire history file when I needed to get rid of something in the history file I did not want others to see.

 

I did some further reading and discovered there is a way to prevent a command from going into your history file.  I have configured both jump boxes to allow the use of this methodology.

Basically any time you place a space in front of a command it will not go into your history file.

 

“ping 10.60.0.19”  will go into your history file

“ ping 10.60.0.19” will not go into your history file.

 

You will need to sign out and back into the jumpbox to have this thing applied to your account as it is setup in a global shell script that all users run.  Once you sign out and back in, you can use this technique.

“ export https_proxy=http://username:password@10.60.0.19:80/”

“ export http_proxy=http://username:password@10.60.0.19:80/”

 

The above commands will not show in your history thereby hiding your creds from others.  The first set in the beginning of the email will still go into your history file.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...