【发布时间】:2018-04-16 00:22:27
【问题描述】:
我需要通过跳转框 (Azure VM) 从本地计算机连接到 Azure SQL DB。我使用以下命令设置端口转发:
ssh -fN -L 41433:my-db.database.windows.net:1433 me@jump-box
我可以确认隧道已设置,因为在详细模式下我看到了消息
Local connections to LOCALHOST:41433 forwarded to remote address my-db.database.windows.net:1433
现在,当我跑步时
sqlcmd -S 127.0.0.1,41433 -U username -P password -d db
我收到以下错误消息
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : [Microsoft][ODBC Driver 13 for SQL Server]
[SQL Server]Cannot open server "127.0.0.1" requested by the login. The login failed..
我确保/etc/ssh/sshd_config 有GatewayPorts yes 和AllowTcpForwarding yes 行
谁能帮我弄清楚我做错了什么?
【问题讨论】:
标签: azure ssh azure-sql-database sqlcmd ssh-tunnel