Sunday, March 27, 2022

Using Key Pair Authentication & Key Pair Rotation

 

Using Key Pair Authentication & Key Pair Rotation

SnowSQL supports key pair authentication and key rotation, but does not support unencrypted private keys.

  1. To start, follow the instructions to configure Key Pair Authentication & Key Pair Rotation.

  2. Specify the path to the private key file either in the configuration file or on the command line:

  • In the configuration file:

    • Add the private_key_path connection parameter to your connection settings and specify the local path to the private key file you created. The syntax is not OS-specific:

      Supported OS
      private_key_path = <path>/rsa_key.p8
      
    • Use the SNOWSQL_PRIVATE_KEY_PASSPHRASE environment variable to set the passphrase for decrypting the private key file. The syntax is OS-specific:

      Linux/macOS
      export SNOWSQL_PRIVATE_KEY_PASSPHRASE='<passphrase>'
      
    Windows
    set SNOWSQL_PRIVATE_KEY_PASSPHRASE='<passphrase>'
    
  • On the command line:

    Include the private-key-path connection parameter and specify the path to your encrypted private key file:

    $ snowsql -a <account_identifier> -u <user> --private-key-path <path>/rsa_key.p8
    

    SnowSQL prompts you for the passphrase. Alternatively, use the SNOWSQL_PRIVATE_KEY_PASSPHRASE environment variable to set the passphrase for decrypting the private key file (as described above).

No comments:

Post a Comment

Recent Post

Databricks Delta table merge Example

here's some sample code that demonstrates a merge operation on a Delta table using PySpark:   from pyspark.sql import SparkSession # cre...