StoryCode

'Database 관리/MSSQL'에 해당되는 글 1건

  1. MSSQL.Client.MSSQL-TOOLS.SQLCMD.Ubuntu22 설치

MSSQL.Client.MSSQL-TOOLS.SQLCMD.Ubuntu22 설치

Database 관리/MSSQL
반응형

# https://learn.microsoft.com/ko-kr/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver16#ubuntu18

 

nmap --script ssl-enum-ciphers 202.30.110.132 # Check 1433.TLSv1.0

1433/tcp open  ms-sql-s
| ssl-enum-ciphers:
|   TLSv1.0: # <============= 확인
|     ciphers:
|       TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (ecdh_x25519) - A
|       TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (ecdh_x25519) - A
|       TLS_DHE_RSA_WITH_AES_256_CBC_SHA (dh 2048) - A
|       TLS_DHE_RSA_WITH_AES_128_CBC_SHA (dh 2048) - A
|     compressors:
|       NULL
|     cipher preference: server
|     warnings:
|       Weak certificate signature: SHA1
|_  least strength: A
  vi /etc/ssl/openssl.cnf
    [system_default_sect]
    MinProtocol = TLSv1 #<=========== TLVv1
    CipherString = DEFAULT:@SECLEVEL=0 #<======= No Cipher
if ! [[ "18.04 20.04 22.04" == *"$(lsb_release -rs)"* ]];
then
    echo "Ubuntu $(lsb_release -rs) is not currently supported.";
    exit;
fi

sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -

curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list

exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
sudo apt-get install -y unixodbc-dev

cd /opt/mssql-tools18/bin
./sqlcmd -C -S 123.456.789.012 -U userid -P password # -C 는 Error.Protocol 발생시 추가
    1> user master
    2> select @@ServiceName
    3> go
반응형