电脑经常死机不蓝屏 屏幕不动或者屏幕直接不动了,硬盘灯也不亮,只能强制重启 是什么问题

利用SSH绕过VPN穿透防火墙登陆公司内网的方法_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
利用SSH绕过VPN穿透防火墙登陆公司内网的方法
上传于|0|0|文档简介
&&使家里用笔记本电脑就可以访问公司内网
阅读已结束,如果下载本文需要使用0下载券
想免费下载更多文档?
定制HR最喜欢的简历
你可能喜欢1981人阅读
linux(1)
& & 最近因为工作原因需要SSH到内网服务器,网上搜了一下,才发现SSH的功能真是强大的多,不仅能解决我的问题,还有其他更NB的功能呢.
& & 下面是IBM的一篇文章,详细介绍了这些功能,人家写的这么好,我就直接贴出来吧.
& & 其中远程转发功能可以解决内网穿透的问题,本地转发可以突破内网访问的限制,动态转发可以突破内网限制上网.
& & 想起来几年前接腾讯的支付API,要求只能在腾讯云平台上调用,如果我能早知道本地转发这个功能,就不用费心部署nginx反向代理了.
& & 实际使用中还有几个参数需要介绍.
& & -C 数据压缩,这个不多说了.
& & -f&Requests ssh to go to background just before command execution. &This is useful if ssh is going to ask for passwords or passphrases, but the user wants it in the background.后台执行命令.使用起来会是这个样子:
& & localusername@localserver:~$ ssh -f -L 1521:localhost:1521 remoteusername@192.168.20.250
& & Cannot fork into background without a command to execute.
& & localusername@localserver:~$ ssh -f -L 1521:localhost:1521 remoteusername@192.168.20.250 &sleep 5;echo word&
& &&remoteusername@192.168.20.250's password: [enter password here]
& &&localusername@localserver:~$ hello&word
& & 这个参数一般配合-N参数一起使用,实现后台运行.
& & -N & & &Do not execute a remote command. &This is useful for just forwarding ports.
& &&-g & & &Allows remote hosts to connect to local forwarded ports.
& & 本地端口转发时,默认转发端口只允许本地程序访问,使用-g参数才可以接受远程主机连接.这个参数和-L一起使用时才起作用,和-R一起使用时无用.如果公司使用了远程转发,又需要在家里远程登录的,则需要再在VPS上执行本地转发一次,并且使用-g参数.
& & 实际使用时,经常出现连接断开或无响应的情况,需要设置连接心跳.
& & 修改~/.ssh/config文件,增加如下内容:
& & Host *
& & ServerAliveInterval 30
& & 如果依然有问题,增加如下内容再重试:
& &&TCPKeepAlive yes
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:7742次
排名:千里之外
(1)(1)(2)(3)(1)(1)n2n内网穿透神器(一条命令实现穿透)(linux,安卓,win,openwrt全介绍)-爱编程
n2n内网穿透神器(一条命令实现穿透)(linux,安卓,win,openwrt全介绍)
百度百科:N2N,内衣服饰品牌于上世纪九十年代在美国诞生,经历逾二十几年的不断拓展,现发展成为庞大的跨国内衣服饰品牌,其连锁专卖店网络遍布全球100多个国家大、中城市,数目逾万间,无论品牌定位、潮流款式都能满足全球广大消费者对优质内衣服饰之需求,是享誉国际的内衣服饰品牌之一。随着中国经济的快速发展和中国消费者对高端内衣服饰需求量的日益增加,并结合N2N全球发展战略的规划,N2N于2012年正式登陆大中华…
什么鬼?
google:n2n&is
an open source&Layer 2&over&Layer 3&VPN&application
which utilises a&peer-to-peer&architecture for network membership and routing.Unlike
many other VPN programs, n2n can also connect computers which reside behind&NAT&routers. These connections are set up with help from a third computer
that both computers can reach. This computer, called a supernode, can then route the information between&NATed&nodes.[2]It is&free
software&licensed under the terms of the&GNU General Public License&v3。
好吧,进入正题!
n2n的github地址:/meyerd/n2n.git
下载下来我们会发现2个版本,这里默认介绍V1版本,已经在linux,安卓,win,openwrt上互通,v2版本未测
Linux下面:git clone&/meyerd/n2n.git以后,然后进入V1版本编译运行即可
n2n编译完了的命令不是n2n,而是edge和supernode
edge是....怎么形容,就说客户端吧,而supernode则是服务器超级节点,用法也是很简单的,首先看看edge的help:
edge -d &tun device& -a &tun IP address& -c &community& -k &encrypt key& -s &netmask& [-u &uid& -g &gid&][-f][-m &MAC address&]
-l &supernode host:port& [-p &local port&] [-M &mtu&] [-t] [-r] [-v] [-b] [-h]
-d &tun device&
| tun device name
-a &tun IP address&
| n2n IP address
-c &community&
| n2n community name
-k &encrypt key&
| Encryption key (ASCII) - also N2N_KEY=&encrypt key&
-s &netmask&
| Edge interface netmask in dotted decimal notation (255.255.255.0)
-l &supernode host:port& | Supernode IP:port
| Periodically resolve supernode IP
| (when supernodes are running on dynamic IPs)
-p &local port&
| Local port used for connecting to supernode
| User ID (numeric) to use when privileges are dropped
| Group ID (numeric) to use when privileges are dropped
| Fork and run as a daemon. Use syslog.
-m &MAC address&
| Choose a MAC address for the TAP interface
| eg. -m 01:02:03:04:05:06
| Specify n2n MTU (default 1400)
| Use http tunneling (experimental)
| Enable packet forwarding through n2n community
具体上面已经介绍的很清楚了,现在实战怎么开启,一句话:
sudo edge -d edge0 -a 94.03.05.01 -c lunaw -u 1000 -g 1000 -M 1200 -k xiaojunyu -l xx.xx.xx.xx:xxxx -m 94:03:05:00:10:01 & /dev/null &
现在简单介绍下上面这条命令的含义,-d edge0就是创建一个虚拟的网卡设备,edge0就是它的名称,-c -k就是用户名和密码,-a
虚拟的IP地址,随便取,只要你的所有设备在一个网段即可,然后 -u -g这个是设置UID和GID 也可以不设置,-m
&虚拟mac地址,设置了有好处,只要不相同即可,不设置回随机分配,最后有一个重要的地方,-M 1200,这里是设置MTU,至于MTU是什么,可以自行百度哈,没设置之前,ssh,http等协议会卡住死活连不上,设置后就正常了,需要比1400小,安卓上不用设置,这样设置以后就可以ping通你的其他机器了,只要它可以访问到超级节点 -l xx.xx.xx.xx:xxxx
现在介绍supernode,这个是创建超级节点,root权限都不需要,直接supernode -l 端口号,就行了。网上有免费的超级节点,不过都很慢,很卡,很蛋疼,建议自己买个阿里的vps,又便宜,100M宽带一个月32块钱,那速度,只有一个字,飞快,视频在线传输都没问题,我上班都可以通过n2n查看家里的摄像头...
好了,linux下面的就这样,客户端就是那一句话,很方便,开机自动连接,超级节点自己搭建一个,其他机器都可以用这个节点
下面介绍win下面怎么搭建n2n:win下面其实也很简单,下个软件设置下就OK了
地址是http://www.vpnhosting.cz/n2nguien.exe提供了一个安装包,里面包含了V1和V2版本,请选择V1版本
单击advanced按键,勾选Enable packet forwarding through n2n community,然后其他的自己看,和Linux下的设置一样
http://download.csdn.net/detail/leekwen/8604177
RX什么ACK就表示连通了,可以用超级终端ping通,或者ssh连接
其实安卓上有arm linux,不过不好打字,我现在也没怎么用,在arm linux里面你可以下载更新和pc一样,还可以vnc进桌面。
好了,安卓版就说到这里了。
下面介绍OpenWrt的n2n配置,这些都是很有价值的,具体价值自己去想
首先安装n2n,可以编译的时候编译进去。make menuconfig里面找到network-&vpn-&n2n选中即可,或者编辑.config,搜n2n改成=y
或者在板子里面opkg update && opkg install n2n即可
下面看看n2n的配置文件:
config edge
option community 'username'
option key 'password'
option port 'port'
option supernode 'xx.xx.xx.xx'
option ipaddr 'xx.xx.xx.xx'
option route '1'
好,现在分析一下配置文件,community就是用户名,key就是密码对应edge命令的-c -k,supernode是超级节点的ip地址,port是端口,对应edge的-l,然后ipaddr是虚拟ip地址,对应-a,route对应-r参数,就是设置是否通过n2n转发,然后我们来看看openwrt下面n2n的服务程序:
start_instance() {
local cfg=&$1&
config_get type &$cfg& TYPE
case &$type& in
config_get ipaddr &$cfg& 'ipaddr'
[ -n &$ipaddr& ] || return 1
config_get supernode &$cfg& 'supernode'
config_get port &$cfg& 'port'
config_get community &$cfg& 'community'
config_get key &$cfg& 'key'
config_get_bool route &$cfg& 'route' '0'
[ &$route& = &1& ] && args='-r'
service_start /usr/sbin/edge -f $args -a $ipaddr -c $community -k $key -l ${supernode}:${port}
supernode)
config_get port &$cfg& port
[ -n &$port& ] || return 1
service_start /usr/sbin/supernode -l $port
}上面是启动的主要函数:首先是读取config 这个type,判断是edge还是supernode如果是supernode则只读取port ,运行命令 supernode -l port,如果type是edge,则读取....等配置文件,然后edge -f $args -a $ipaddr -c $community -k $key -l ${supernode}:${port}上面的 -f是作为一个服务启动,写入syslog
好了这样配置好了就可以访问到路由器的,只要路由器连了外网,就可以随时访问进去
n2n的介绍到此结束,很好很强大的一个功能,基本上人手必备神器,小巧,开源,迅速,免费,无限穿透!
版权声明:本文为博主原创文章,未经博主允许不得转载。
版权所有 爱编程 (C) Copyright 2012. . All Rights Reserved.
闽ICP备号-3
微信扫一扫关注爱编程,每天为您推送一篇经典技术文章。

我要回帖

更多关于 死机不蓝屏 屏幕不动 的文章

 

随机推荐