How to connect to ClickHouse using SSH Keys
How to connect to ClickHouse and ClickHouse Cloud using SSH Keys
Question
How can I connect to ClickHouse using SSH Key Authentication?
note
We use ClickHouse Cloud as an example here, but this example should also work on oss ClickHouse.
Answer
- Use ssh-keygen to create the keypair. Example:
- Use the public key (ch_key.pub in above example) to create the USER.
- 
Run SHOW usersto confirm the user creation.
- 
Grant default_role to the user (optional). 
- Use the private key now to authenticate against the service.
 · 2 min read
