How do I log into the Dedicated Admin Console (DAC) on Linux? sqlcmd is documented to have,


  Login-Related Options
  
  -A
  Logs in to SQL Server with a Dedicated Administrator Connection (DAC). This kind of connection is used to troubleshoot a server. This will only work with server computers that support DAC. If DAC is not available, sqlcmd generates an error message and then exits. For more information about DAC, see Diagnostic Connection for Database Administrators. The -A option is not supported with the -G option. When connecting to SQL Database using -A, you must be a SQL server administrator. The DAC is not availble for an Azure Active Directory adminstrator.
Clients

There are two Linux clients from Microsoft that can connect to SQL Server's Dedicated Administrator Connection (DAC),


mssql-cli. Versions newer than 0.90 have the -A option to connect to the Dedicated Administrator Connection (DAC). (QUOTED_IDENTIFIERS is on by default).

mssql-cli -S localhost -U sa -A

sqlcmd. This is the older client that ships with the mssql-tools package. It should never be used. If you insist on using it, you'll have to get accustomed to GO. Don't foget to always use -I with sqlcmd to turn on QUOTED_IDENTIFIERS. No idea why Microsoft chose the admin: prefix for sqlcmd. On most other clients, they use -A flag.

sqlcmd -I -S admin:localhost -U sa



Server Settings

If connecting from outside localhost you may have to enable remote DAC first. To do that simply run

sp_configure 'remote admin connections', 1 
GO
RECONFIGURE
GO