① linux伺服器如何使用代理
不同的代理伺服器設置略有 不同,具體分類操作如下:
設置HTTP及HTTPS代理
對於http及https類型的請求,可以通過設置http_proxy或。方法是export http_proxy=http://proxyaddress:port。
可以寫在$HOME/.bash_profile或/etc/profile中。
設置tsocks代理
見:http://renyongjie668.blog.163.com/blog/static/16005312011824112410588/
有了tsocks代理,其實後面其他設置方式都不是很重要了,幾乎都可以用tsocks來做。
設置SSH代理
同樣用tsocks來實現代理。
Ubuntu中apt-get代理設置
新版的Ubuntu已經不支持export http_proxy就能給apt-get設置代理的方式了。這種方法要用到/etc/apt/文件夾下的apt.conf文件。注意: 某些情況下,系統安裝過程中沒有建立apt配置文件。下面的操作將視情況修改現有的配置文件或者新建配置文件。
sudo vi /etc/apt/apt.conf
在您的apt.conf文件中加入下面這行(根據你的實際情況替換yourproxyaddress和proxyport)。
Acquire::http::Proxy "http://proxyaddress:port";
如果需要用戶名密碼登陸:
Acquire::http::Proxy "http://username:password@proxyaddress:port";
保存apt.conf文件。(其他的協議自己可以適當修改)
② 如何將linux設置為代理伺服器
linux自帶firefox 打開FireFox,編輯->首選項->常規->連接 設置FF訪問網際網路的方式 連接設置 手動配置代理 然後輸入代理伺服器IP和埠號即可。
③ linux 如何設置代理
linux設置代理linux系統設置yum,wget,rpm命令使用代理:1.Using
yum
with
a
proxyserver---------------------------------------To
enable
yum
operations
to
use
aproxy
server
you
should
first
add
the
following
parameter
to
/etc/yum.conf
proxy=http://yourproxy:8080/
where
yourproxy
is
the
name
of
the
proxy
server
you
want
to
access
and
8080
isthe
proxy
port.
If
the
server
requires
authentication
you
can
specify
the
logincredentials
like:proxy=http://username:password@yourproxy:8080/---------------------------------------2.
The
rpm
package
manager
makesuse
of
the
proxy
environment
variable.
This
can
be
set
system
wide
in
/etc/profile
or
user
specific
in
~/.bash_profile:export
http_proxy=http://yourproxy:8080/export
ftp_proxy=http://yourproxy:8080/---------------------------------------3.
To
use
wget
throug
a
proxy
serveradd
the
following
lines
to
/etc/wgetrc
http_proxy
=
http://yourproxy:8080/
ftp_proxy
=
http://yourproxy:8080/
④ Linux上如何搭建代理給其他電腦用
可以配置單網卡代理伺服器。
安裝squid代理伺服器之後,需要設置Linux的主機名為FQDN的格式,並且要保證能夠解析出來。
首先運行squid -z進行初始化,然後要修改squid的配置文件:/etc/squid/squid.conf
加入如下條目:
acl mynet 192.168.1.0/24
http_access allow mynet
啟動服務:service squid start
圖形化的工具可以嘗試webmin