Skip to content

Commit 05c6a26

Browse files
authored
Merge pull request #20305 from WilliamAntonRohm/issue-6645-password-algo
sql-docs/issues/6645 -- update bash pwd algorithm
2 parents 2b3f6b6 + bdf7652 commit 05c6a26

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

docs/linux/quickstart-install-connect-docker.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,19 +326,25 @@ Setting `-h` and `--name` to the same value is a good way to easily identify the
326326

327327
The **SA** account is a system administrator on the SQL Server instance that gets created during setup. After creating your SQL Server container, the `SA_PASSWORD` environment variable you specified is discoverable by running `echo $SA_PASSWORD` in the container. For security purposes, change your SA password.
328328

329+
::: zone pivot="cs1-bash"
329330
1. Choose a strong password to use for the SA user.
330331

331-
1. Use `docker exec` to run **sqlcmd** to change the password using Transact-SQL. In the following example, replace the old password, `<YourStrong!Passw0rd>`, and the new password, `<YourNewStrong!Passw0rd>`, with your own password values.
332+
1. Use `docker exec` to run **sqlcmd** to change the password using Transact-SQL. In the following example, the old and new passwords are read from user input.
332333

333-
::: zone pivot="cs1-bash"
334334
```bash
335335
sudo docker exec -it sql1 /opt/mssql-tools/bin/sqlcmd \
336-
-S localhost -U SA -P "<YourStrong@Passw0rd>" \
337-
-Q 'ALTER LOGIN SA WITH PASSWORD="<YourNewStrong@Passw0rd>"'
336+
-S localhost -U SA \
337+
-P "$(read -sp "Enter current SA password: "; echo "${REPLY}")" \
338+
-Q "ALTER LOGIN SA WITH PASSWORD=\"$(read -sp "Enter new SA password: "; echo "${REPLY}")\""
339+
338340
```
339341
::: zone-end
340342

341343
::: zone pivot="cs1-powershell"
344+
1. Choose a strong password to use for the SA user.
345+
346+
1. In the following example, replace the old password, `<YourStrong@Passw0rd>`, and the new password, `<YourNewStrong@Passw0rd>`, with your own password values.
347+
342348
```PowerShell
343349
docker exec -it sql1 /opt/mssql-tools/bin/sqlcmd `
344350
-S localhost -U SA -P "<YourStrong@Passw0rd>" `
@@ -347,9 +353,13 @@ The **SA** account is a system administrator on the SQL Server instance that get
347353
::: zone-end
348354

349355
::: zone pivot="cs1-cmd"
356+
1. Choose a strong password to use for the SA user.
357+
358+
1. In the following example, replace the old password, `<YourStrong@Passw0rd>`, and the new password, `<YourNewStrong@Passw0rd>`, with your own password values.
359+
350360
```cmd
351361
docker exec -it sql1 /opt/mssql-tools/bin/sqlcmd `
352-
-S localhost -U SA -P "<YourStrong!Passw0rd>" `
362+
-S localhost -U SA -P "<YourStrong@Passw0rd>" `
353363
-Q "ALTER LOGIN SA WITH PASSWORD='<YourNewStrong@Passw0rd>'"
354364
```
355365
::: zone-end

0 commit comments

Comments
 (0)