gongxiangp2/scripts/test-frp-ssh.bat

28 lines
709 B
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
echo 测试FRP服务器SSH密钥连接...
echo.
set KEY_PATH=%USERPROFILE%\.ssh\id_rsa_frp_180.97.221.140
set SERVER=root@180.97.221.140
set PORT=22
echo 使用密钥: %KEY_PATH%
echo 连接服务器: %SERVER%
echo.
ssh -i "%KEY_PATH%" -o ConnectTimeout=10 -o ServerAliveInterval=3 -p %PORT% %SERVER% "hostname && echo SSH密钥连接成功!"
if %ERRORLEVEL% EQU 0 (
echo.
echo ========================================
echo SSH密钥配置成功!
echo ========================================
) else (
echo.
echo ========================================
echo SSH连接失败,错误代码: %ERRORLEVEL%
echo ========================================
)
pause