UM-Flint ITS Helpdesk - http://www.umflint.edu/helpdesk
Setting Up internet access in Linux via command Line
http://www.umflint.edu/helpdesk/articles/4/1/Setting-Up-internet-access-in-Linux-via-command-Line/Page1.html
Zack Powers

 
By Zack Powers
Published on 04/7/2008
 
This quicknote is for setting up command line applications (like yum, wget, apt-get, etc) to acess the internet via the http_proxy enviroment variable.

Note: ITS Help Desk doesn't support Linux.

Using BASH and "~/.profile" versus "/root/.profile" versus "/etc/profile" & Linux access to the Internet

  1. The user  file, "~/.profile", which is a hidden file in a user's home directory, sets up BASH settings for that specific user.
  2. The "/root/.profile" is the runtime configuration file for the root user.
  3. Setting proxy variables for the root is often useful for setting up deamons to use a proxy, like the cron deamon which often runs as root.

Setting up the http_proxy enviroment variable


  1. Open the profile file in any text editor of your choosing, ie. "nano ~/.bashrc".
  2. Add to the end of the file the following text, replacing <uniqname> and <password> with your uniqname and LAN password:  #Setting Proxy Enviroment Variable  export http_proxy="http://<uniqname>:<password>@webproxy.umflint.edu:8080/"
  3. Save and exit the text editor and restart your terminal.

For programs that use other shells(such as sh, dash, and ksh) repeat the process above with the file "~/.profile", "/etc/profile", and "/root/.profile".

If you are concerned about your password being in the .bashrc file you can change the permissions of the file so only you can read it with the command:
  chmod 700 .profile

  To test your setting try the following command:
  wget www.google.com
 If it sucessfully downloads index.html then you are connected through webproxy!