-1

I have local users created for my server, though I understand that passwords are stored inside /etc/shadow file; is it possible to store it in a database as well including the records of previous passwords?

halfer
  • 19,824
  • 17
  • 99
  • 186
DonX
  • 43
  • 2
  • 10

1 Answers1

1

Yes.

There is a system called NSS, that manages the databases of users, groups, etc. The file /etc/nsswitch.conf (it has a man page). It allows letting the system know where each type of data is actually stored.

Precise details of how to do what you want depend on the precise database you want to use etc, but this should give you enough to know what to look for.

Shachar Shemesh
  • 8,193
  • 6
  • 25
  • 57
  • Hi Shachar, Thanks mate. I'll look that up. Will let you know how it goes. – DonX Sep 28 '17 at 10:32
  • # To use db, put the "db" in front of "files" for entries you want to be # looked up first in the databases # # Example: #passwd: db files nisplus nis #shadow: db files nisplus nis #group: db files nisplus nis passwd db files winbind shadow: db files winbind group: db files winbind Trying this out. – DonX Sep 28 '17 at 10:34
  • I have enabled DB in the NSSWITCH.CONF for passwd shadow and groups, tried logging in via ssh, but can't seem to figure out where is the db located in mysql. any suggestions? – DonX Sep 28 '17 at 10:38
  • The reason I didn't put in the specific changes to `nsswitch.conf` is because this is the smallest issue you have. You need to read the docs of your mysql nis connector to see how to configure them together. – Shachar Shemesh Sep 28 '17 at 11:04
  • I'm sorry. I'm very new with Linux esp this particular thing. Can you suggest a link for that document where i can read through about mysql and NSS configuration? – DonX Sep 28 '17 at 14:07
  • Try searching for "nss linux mysql". – Shachar Shemesh Sep 28 '17 at 19:27