Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 1.35 KB

File metadata and controls

31 lines (26 loc) · 1.35 KB
author rwestMSFT
ms.author randolphwest
ms.date 11/18/2024
ms.service sql
ms.subservice linux
ms.topic include
ms.custom
linux-related-content
sfi-ropc-blocked

The sa account is a system administrator on the [!INCLUDE ssnoversion-md] instance that's created during setup. After you create your [!INCLUDE ssnoversion-md] container, the MSSQL_SA_PASSWORD environment variable you specified is discoverable by running echo $MSSQL_SA_PASSWORD in the container. For security purposes, change your sa password:

  1. Choose a strong password to use for the sa account. [!INCLUDE password-complexity]

  2. Use docker exec to run the sqlcmd utility to change the password through a Transact-SQL statement. Replace <old-password> and <new-password> with your own password values:

    [!IMPORTANT]
    The SA_PASSWORD environment variable is deprecated. Use MSSQL_SA_PASSWORD instead.

    sudo docker exec -it sql1 /opt/mssql-tools/bin/sqlcmd \
       -S localhost -U sa -P '<old-password>' \
       -Q 'ALTER LOGIN sa WITH PASSWORD="<new-password>"'
    docker exec -it sql1 /opt/mssql-tools/bin/sqlcmd `
       -S localhost -U sa -P "<old-password>" `
       -Q "ALTER LOGIN sa WITH PASSWORD='<new-password>'"