Jump to content
  • Announcements

    • dennis

      Welcome to theZAh   06/09/2016

      Enjoy the site and let us know if you find anything not appropriate... silly spammers.
wildweaselmi

Setting up apt-get to use a http-proxy

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/


Share this post


Link to post
Share on other sites

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]


Share this post


Link to post
Share on other sites
dennis    2

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.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×