周海漢 2010年07月2日
使用了goddady的linux虛擬主機,提供ssh。但使用ssh -D port xxx@server時,遇到ssh上打印如下錯誤:
channel 3: open failed: administratively prohibited: open failed
firefox瀏覽器配置了socks5指向本地的port時,瀏覽任何網頁顯示空白。
這是什麼原因呢?
ssh上去,打開sshd_config看一下,
cat /etc/ssh/sshd_config
有一行:
AllowTcpForwarding no
原來主機設置了禁止ssh的tcp 端口轉發。那想用ssh做代理進行端口轉發肯定是不成功的。
再查看系統配置,也禁止了ip轉發;
cat /etc/sysctl.conf | grep ip_forward
net.ipv4.ip_forward = 0
所以,該虛擬主機提示端口轉發被禁止,正常。