0

I'm auditing some servers and I have a table called "Servers" with a few fields.

One of these is a field called "users"

I have another table called "users" which holds information on each user. Of course, there are many "root" users (one for each server) so I don't know if a single table for users is appropriate for this.

Information on users include things like their SSH key, username, home directory etc. What's the best way of designing a database, and a form to enter this information easily?

Kara
  • 6,115
  • 16
  • 50
  • 57
Ivy
  • 3,393
  • 11
  • 33
  • 46

1 Answers1

1

Yes, a single table for all users is appropriate

Forget about the users field in your servers table, this isn't how relationships work in relational databases.

Your users table should have a field (perhaps called server_id) which has a foreign key relationship with "server"'s primary key.

Once you have your 2 tables set up you can use the form wizard to create a form for servers which has a subform for users and libreoffice will do most of the work for you in laying it out, just select all fields for the subform apart from server_id (the subform will manage that for you)

You may also want to consider splitting ssh keys into a separate table and further nested sub-form, as users can have more than one.


Bear in mind that this solution is not fully normalized, any time a user has an account on more than one server there is potential for duplication. However designing a fully normalized database for your audit seems like it will be overkill and will make working with libreoffice base much harder.

Alfred
  • 21,058
  • 61
  • 167
  • 249
funkyhat
  • 13
  • 5