2014年7月8日星期二

使用混淆之后的ssh连接vps

gfw对ssh的干扰严重到正常的远程管理都受到了影响,把ssh运行在3389,443端口都无济于事。
通过google我发现了两种解决方案:
1.使用obfsproxy
2.使用obfuscated-openssh

obfsproxy是tor项目的,根据google的结果,目前已经阵亡,于是我使用第二种方案。

服务端安装方法
 git clone https://github.com/brl/obfuscated-openssh.git
 cd obfuscated-openssh

  自定义安装位置, 启用md5和pam支持
 ./configure --prefix=/home/dingjun/openssh-obfs --with-md5-passwords --with-pam --with-pid-dir=/home/dingjun/openssh-obfs/var/run --with-privsep-path=/home/dingjun/openssh-obfs/var/empty
 make 
 make install

配置
修改openssh-obfs/etc/sshd_config文件加入如下配置


ObfuscatedPort 8009  # 监听端口
ObfuscateKeyword  wfgkcuf  # 混淆使用的keyword


启动

sudo /home/dingjun/openssh-obfs/sbin/sshd


客户端

windows 下使用potty, potty是打了混淆补丁的putty,下载地址
http://www.mrhinkydink.com/potty.htm

运行potty.exe, 界面和putty一模一样的

在ssh选项里选中 Enable key exchange obfuscation, 然后输入服务器上配置的ObfuscateKeyword

现在就可以使用了
使用cat /var/log/message 测试一下,连接没有被断开

没有评论:

发表评论