Chinaunix首页 | 论坛 | 博客
  • 博客访问: 135245
  • 博文数量: 44
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 456
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-05 16:22
个人简介

热爱开源

文章分类
文章存档

2022年(1)

2017年(2)

2015年(2)

2013年(4)

2008年(35)

我的朋友

分类: 系统运维

2008-04-16 23:58:47

如何在linux下通过proxy server的认证访问外网?

apt的proxy比较简单。在/etc/apt/apt.conf中添加:

/etc/apt/apt.conf

APT::Authentication::TrustCDROM "true";
Acquire::http::Proxy "";
Acquire::::Proxy "true"


wget 的proxy 它是借助环境变量
export http_proxy=
export ftp_proxy=ftp://proxy.xx.xx:21

如果需要认证则需要编写一个文本
~/.wgetrc
中添加:

proxy-user=username
proxy-password=password


w3m 的代理上网可以参考使用proxychains工具。

具体配置需要在 /etc/proxychains.conf中进行设置。

/etc/proxychains.conf


# proxychains.conf VER 2.0
#
# HTTP, SOCKS4, SOCKS5 tunneling proxifier.
#

# The option below identifies how the ProxyList is treated.
# only one option should be uncommented at time,
# otherwise the last appearing option will be accepted
#
# Dynamic - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# at least one proxy must be online to play in chain
# (dead proxies are skipped)
# otherwise EINTR is returned to the app
#
# Strict - Each connection will be done via chained proxies
# all proxies chained in the order as they appear in the list
# all proxies must be online to play in chain
# otherwise EINTR is returned to the app
#
# Random - Each connection will be done via random proxy
# (or proxy chain, see chain_len) from the list
# this option is good for scans

#dynamic_chain
#strict_chain
random_chain

# Make sense only if random_chain
# 一定要注意,这个值要和下面定义的 proxy list 的个数一致
chain_len = 1

# Quiet mode (no output)
quiet_mode

# Write stats about good proxies to proxychains.stats
#write_stats

#Some timeouts in milliseconds
#
tcp_read_time_out 15000
tcp_connect_time_out 10000

[ProxyList]
# ProxyList format
# type host port [user pass]
# (values separated by 'tab' or 'blank')
#
#
# Examples:
#
# socks5 192.168.67.78 1080 lamer secret
# http 192.168.89.3 8080 justu hidden
# socks4 192.168.1.49 1080
# http 192.168.39.93 8080
#
#
# proxy types: http, socks4, socks5
# ( auth types supported: "basic"-http "user/pass"-socks )
#
#http 10.0.0.5 3128
#http 10.0.0.3 3128
#http 10.0.0.5 3128
#socks5 192.168.1.4 1080
#socks4 10.5.81.143 1080
#http 192.168.203.18 8080

http proxy.xxx.xxx 80 username password


目前没有解决firefox的代理认证方法。(其实有个方案,就是在本机搭建一个简单的proxyserver,然后firefox+FoxyProxy来进行穿越)
阅读(8364) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~