Wondering if it is possible to use ssh keys in place of password in a sas libname statement?
Something like one uses to connect remotely to a linux machines using ssh
Hello @esbabu
If the intention is to prevent using username and password in the code, considering using preassigned libraries, either create database connection and library in the metadata server OR create libname statement in the autoexec_usermod.sas.
That should serve the purpose.
What LIBNAME engine does this relate to? By default if you don't specify an engine it will default to V9, to access or create SAS V9 datasets in a SAS library. If this is the engine you are referring to, then any connection to a remote server folder needs to be done in the SAS server OS outside of SAS.
Thank you @SASKiwi for the reply.
What I was exploring is the ability to use public/private key combination in a libname statement (for example to MySQL, snowflake, data bricks using odbc or SAS Access engines ) instead of username /password combination.
I agree the database too should support it.
When you define a LIBNAME to a remote database, SAS uses the database's client (which must be installed and configured on the SAS computer). How this client uses encryption in the connection to the DB server must be configured in the client, not in SAS. In SAS you only provide the credentials for the DB, and those are user/password.
As @Kurt_Bremser has stated, use of public / private keys is more a database configuration, not something you do in SAS. If the database does not support this capability then there is no way for SAS to provide it. Here are the setup details for MySQL: https://dev.mysql.com/doc/mysql-secure-deployment-guide/5.7/en/secure-deployment-connect.html
This is a job for your MySQL DBA to configure as it is highly unlikely end users have the right permissions.
Hello @esbabu
If the intention is to prevent using username and password in the code, considering using preassigned libraries, either create database connection and library in the metadata server OR create libname statement in the autoexec_usermod.sas.
That should serve the purpose.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.