GoAgent 3.15启动后 error 13 关于DNS权限问题的处理方法
1、该问题貌似只发生在非windows系统(windows下右键以管理员身份运行?)上,原因是权限问题 2、问题描述:以普通用户登陆linux系统双击运行“goagent-gtk.py”,弹窗并报错如下
Traceback(most recent call last): File “/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py”,line327,in run result=self._run(*self.args,**self.kwargs) File “/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py”,line282,in serve_forever self.start() File “/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py”,line234,in start self.init_socket() File “/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py”,line118,in init_socket self.socket=self.get_listener(self.address, self.family) File “/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py”,line128,in get_listener return _udp_socket(address, reuse_addr=self.reuse_addr, famili=family) File “/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py”,line171,in udp_socket socket.bind(address) File “”, line 1,in bind error:[error 13] Permission denied:(‘127.0.0.1’,53) » failed with error INFO - [Feb 21:41:39] 127.0.0.1:55620 “GET /proxy.pac HTTP/1.1” 200 -
在终端命令行运行sudo python goagent-gtk.py则没有报错信息。GoAgent 3.15完美运行。
解决方法: 3.1.5开始 GoAgnet 对dnsproxy 功能做优化。
因为这个功能要占用53端口,而大部分系统对53端口规划在系统保留端口上,这样在没有root权限去执行GoAgnet时, 这部分功能会出现错误。
解决办法一 开机启动:
找到/etc/rc.local 加入你的启动代码。 但这样有个问题,Goagent客户端运行并不稳定, 有时候会出现无法访问, 重启这个脚本就比较麻烦,需要kill 然后sudo 执行一下。
python [PATH]/local/proxy.py 2>%1 > /dev/null &
解决方法二 端口转发
修改proxy.user.ini:
[dns] enable=1 listen=127.0.0.1:8053
然后命令行执行端口转发:
sudo ipfw add 100 fwd 127.0.0.1,8053 udp from any to any 53 in
这种方法可以直接使用goagent/local 中自带的 goagent-osx 或者goagent-gtk 等等这些启动脚本启动,这样你的状态栏中会有一个简单的控制工具,还是比较好用的。但无论是ipfw(mac)还是iptables(linux),配置都是一个相对复杂的东西,和系统各种其他配置都有千丝万缕的关系,如果你不是位技术或者不是一位有技术支持的人,这个操作是有风险性的。要慎重。
解决方法三
这个方法算是比较嘹亮的处理方法,补充一个新的脚本,内容如下:
在你的goagent/local代码目录下新建一个文件start.command, 内容如下:
#!/usr/bin/env sh sudo ${0%/*}/goagent-gtk.py
这样每次启动, 你只需要双击这个start.command 脚本,紧跟着需要你输入你系统的权限密码,输出成功后,程序将退出,goagent将使用root权限运行。但需要注意,如果你想在终端执行你的start脚本。需要赋予权限 : chmod +x start.command
参考内容:http://ablegao.me/posts/goagent-permission.html












