0

Is it possible to use MYSQL to store user accounts and use it to authenticate with your SSH (OpenSSH/Dropbear) and is it possible to use remote mysql database?

Basically, I want to use MYSQL as user database and use it to authenticate w/ expiration and if possible I want to use remote mysql database.

  • what you're talking about sounds like an LDAP/Kerberos implementation. It basically allows you to have a centralized storage of users and their passwords among other things. Something like Windows Active Directory. – Waleed Hamra Jun 21 '18 at 07:30
  • 1
    You can also use `AuthorizedKeysCommand` in the sshd_config file to run a custom script that connects to anything as long as it prints public keys back to the console. I'm writing a Golang tool for this at the moment which isn't complete yet on SQL. – Praveen Premaratne Jun 21 '18 at 11:33

1 Answers1

0

In addition the the AuthorizedKeysCommand recommended by @praveen-p (highly recommended), you could use PAM-MySQL for a service (and UsePAM=1 in sshd_config). There are better user account mechanisms and using those over MySQL is recommended.

danblack
  • 1,179
  • 10
  • 14