在虚拟机里使用代理

来源:互联网 发布:长沙排名优化公司电话 编辑:程序博客网 时间:2024/05/17 23:26
  1. Edit the proxy server in /etc/bash.bashrc

rzfwch:~$ gedit/etc/bash.bashrc &

 

# edit the proxy servicer

 

# This function allows you toset up the http and ftp proxies in a terminal window for

# performing "wget",etc. Type proxy at the command line and enter the correct

# id/pw.

functionproxy(){

       echo-n"username: "

       read-e username

       echo-n"password: "

       read-es password

       exporthttps_proxy="https://$username:$password@proxy-apac.delphiauto.net:8080/"

       exporthttp_proxy="http://$username:$password@proxy-apac.delphiauto.net:8080/"

       exportftp_proxy="http://$username:$password@proxy-apac.delphiauto.net:8080/"

       echo""

}

  1. How to use In shell

rzfwch:~$proxy     # enter proxy and press return

username:rzfwch    # enter your netid

password:xxxx      # enter your password

Install software using apt-get

rzfwch:~$ sudo -s   #enter root mode

root:~#proxy

username: rzfwch

password: xxxx

# Using apt-get to installpackage

apt-get update

apt-get install xxxx

...

原创粉丝点击