批处理:SSH互联网河蟹装置
SSH总是在连接一段时间后,就会断开我所使用的服务器,会很标准的一个小时重置一次,万般无奈之下写了这个东西
强调一下,这篇日志不是要告诉你怎么翻墙
还要在强调一下,我国的互联网是开放的、自由的,这仅仅是本人蛋疼才会去消费代理服务器。主要是图这个服务器便宜,我喜欢便宜的东西
“D:\SoftWare\Notepad++\notepad++.exe” GWF.log
rem code by GFW@tossp.com
rem 内部使用版
rem 在这里设置好你的用户名和密码
set myusername=你的用户名
set/a mypassword=你的密码
title usassh.com专用服务器河蟹装置
setlocal enabledelayedexpansion
set/a timee=1000
echo ===============================
echo 正在检测:s9.usassh.com
call :CheckServer s9.usassh.com
if %timee% gtr %tmp% set/a timee=%tmp% & set name=s9.usassh.com
For /L %%i in (10 1 13) do (
echo.
echo ===============================
echo 正在检测:s%%i.usassh.com
call :CheckServer s%%i.usassh.com
if !timee! gtr !tmp! set/a timee=!tmp! & set name=s%%i.usassh.com
echo ===============================)
if “%name%”==”” (echo [%date%]%TIME% — 未检测到可用服务器,随机选择。) else (echo [%date%]%TIME% — 速度最快的是%name% 时间为:%timee% ms)
if “%name%”==”” (echo [%date%]%TIME% — 未检测到可用服务器,随机选择。 >>GWF.log) else (echo [%date%]%TIME% — 速度最快的是%name% 时间为:%timee% ms >>GWF.log)
echo ===============================
set /a w=%random%%%(13-9+1)+9
echo [%date%]%TIME% — 尝试链接s%w%.usassh.com服务器。 >>GWF.log
echo [%date%]%TIME% — 尝试链接s%w%.usassh.com服务器。
if “%name%”==”” (plink.exe -C -N -D 127.0.0.1:7070 %myusername%@s%w%.usassh.com -pw %mypassword% -P 80 -v -i “s%w%keyfile.ppk”) else (plink.exe -C -N -D 127.0.0.1:7070 %myusername%@s%name%.usassh.com -pw %mypassword% -P 80 -v -i “s%name%keyfile.ppk”)
goto :relink
pause>nul
:relink
echo [%date%]%TIME% — 丢失与s%w%.usassh.com的连接。
echo [%date%]%TIME% — 丢失与s%w%.usassh.com的连接。 >>GWF.log
set /a w=%w%+1
if “%w%”==”14” (set /a w=9)
echo [%date%]%TIME% — 尝试链接s%w%.usassh.com服务器。
echo [%date%]%TIME% — 尝试链接s%w%.usassh.com服务器。 >>GWF.log
plink.exe -C -N -D 127.0.0.1:7070 %myusername%@s%w%.usassh.com -pw %mypassword% -P 80 -v -i “s%w%keyfile.ppk”
goto :relink
:CheckServer IP
set/a num=0
for /f “tokens=5 delims=m=” %%i in (‘ping -n 1 %1 ^|find “来自”‘) do (
set/a num+=1
set/a tmp=%%i
echo 速度为:%%i ms)
if %num% EQU 0 echo. & echo 超时
OpenSSH
http://www.openssh.com/
“OpenSSH is a FREE version of the SSH connectivity tools that technical users of the Internet rely on. Users of telnet, rlogin, and ftp may not realize that their password is transmitted across the Internet unencrypted, but it is. OpenSSH encrypts all traffic (including passwords) to effectively eliminate eavesdropping, connection hijacking, and other attacks. Additionally, OpenSSH provides secure tunneling capabilities and several authentication methods, and supports all SSH protocol versions.
The OpenSSH suite replaces rlogin and telnet with the ssh program, rcp with scp, and ftp with sftp. Also included is sshd (the server side of the package), and the other utilities like ssh-add, ssh-agent, ssh-keysign, ssh-keyscan, ssh-keygen and sftp-server.
OpenSSH is developed by the OpenBSD Project. The software is developed in countries that permit cryptography export and is freely useable and re-useable by everyone under a BSD license. However, development has costs, so if you find OpenSSH useful (particularly if you use it in a commercial system that is distributed) please consider donating to help fund the project.
OpenSSH is developed by two teams. One team does strictly OpenBSD-based development, aiming to produce code that is as clean, simple, and secure as possible. We believe that simplicity without the portability “goop” allows for better code quality control and easier review. The other team then takes the clean version and makes it portable (adding the “goop”) to make it run on many operating systems — the so-called -p releases, ie “OpenSSH 5.8p2″.
We sell OpenSSH T-shirts and posters. Sales of these items also help to fund development. Donations and other contributions have come entirely from end-users.
Please take note of our Who uses it page, which list just some of the vendors who incorporate OpenSSH into their own products — as a critically important security / access feature — instead of writing their own SSH implementation or purchasing one from another vendor. This list specifically includes companies like Cisco, Juniper, Apple, Red Hat, and Novell; but probably includes almost all router, switch or unix-like operating system vendors. In the 10 years since the inception of the OpenSSH project, these companies have contributed not even a dime of thanks in support of the OpenSSH project (despite numerous requests). ”
(代理工具)
感谢支持