microsoft / go-sqlcmd

The new sqlcmd, CLI for SQL Server and Azure SQL (winget install sqlcmd / sqlcmd create mssql / sqlcmd open ads)
https://learn.microsoft.com/sql/tools/sqlcmd/go-sqlcmd-utility
MIT License
334 stars 58 forks source link

By default, scope port forwarding to local host, add --allow-remote-access flag #294

Open stuartpa opened 1 year ago

stuartpa commented 1 year ago

Right now sqlcmd create is following the documentation from:

https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-ver16&pivots=cs1-bash

which recommends:

sudo docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=YourStrong@Passw0rd" \ -p 1433:1433 --name sql1 --hostname sql1 \ -d \ mcr.microsoft.com/mssql/server:2022-latest

This allows remote access to port 1433.

We can do better than this by default in sqlcmd create, and lock this port down to local access only, and allow remote access as a non-default flag