windows 修改xhsell安全加密配置

由于xhsell旧版的与新版的有差别,导致新版的不能用旧版的xsh文件

1.将xshell升级到最新版本
2.安装sed与grep到C:\Program Files (x86)\GnuWin32
3.将bat脚本放置xsh的存储路径下,一般为C:\我的文档\Documents\NetSarang\Xshell\Sessions或D:\我的文档\Documents\NetSarang\Xshell\Sessions
4.如右键"以管理员身份运行",出现找不到文件,请直接双击执行

 

 

http://gnuwin32.sourceforge.net/packages/grep.htm

http://gnuwin32.sourceforge.net/packages/sed.htm

 

@echo off
set GUN="C:\Program Files (x86)\GnuWin32\bin"
for /r . %%i in (*.xsh) do @echo %%i >> %cd%\xsh.txt
setlocal enabledelayedexpansion
for /f "delims=" %%i in (%cd%\xsh.txt) do (
 echo %%i
 %GUN%\sed.exe -i -e "s/CipherList=.*/CipherList=aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes256-cbc,rijndael128-cbc,rijndael192-cbc,rijndael256-cbc,aes256-ctr,aes192-ctr,aes128-ctr,rijndael-cbc@lysator.liu.se,arcfour128,arcfour25/g" %%i
REM %GUN%\grep.exe "aes192-ctr" %%i
)
REM echo "已经修改完毕,马上清理xsh.txt文件,任意键继续"
REM pause>null
del %cd%\xsh.txt
echo "修改完毕,任意键结束"
pause>null

 

posted @ 2018-03-16 11:28  IT菜鸟园  阅读(179)  评论(0编辑  收藏  举报