Crate a new, read-only user in postgres

Reference taken from this Article ! Script to Create Read-Only user: CREATE ROLE Read_Only_User WITH LOGIN PASSWORD ‘Test1234’ NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION VALID UNTIL ‘infinity’; Assign permission to this read only user: GRANT CONNECT ON DATABASE YourDatabaseName TO Read_Only_User; GRANT USAGE ON SCHEMA public TO Read_Only_User; GRANT SELECT ON ALL TABLES IN SCHEMA public … Read more

How to do central home directories and user accounts on Ubuntu?

I’ve run something like this in the past. LDAP is your best bet for centralized accounts. This is reasonably standard, and should be easy to set up. The client is merely a matter of installing a few packages (ldap-utils, libnss-ldap, and libpam-ldap), and editing /etc/pam.d/common-(everything). You’ll need to add a line like <type of file … Read more

How to apply PostgreSQL “GRANT ALL ON ALL TABLES” to new tables?

A posible solution is to alter default privileges for u user: Eg: alter default privileges in schema public grant all on tables to u; alter default privileges in schema public grant all on sequences to u; Description ALTER DEFAULT PRIVILEGES allows you to set the privileges that will be applied to objects created in the … Read more

mysql create user if not exists

In 5.7.6 and above, you should be able to use CREATE USER CREATE USER IF NOT EXISTS ‘user’@’localhost’ IDENTIFIED BY ‘password’; Note that the 5.7.6 method doesn’t actually grant any permissions. If you aren’t using a version which has this capability (something below 5.7.6), you can do the following: GRANT ALL ON `database`.* TO ‘user’@’localhost’ … Read more

Simple, centralized user management on a small LAN – NIS or LDAP?

I don’t think anybody uses NIS anymore – or at least, wants to. The fastest and easiest way to get a nice LDAP+Kerberos environment up is FreeIPA. It’s easy and light enough that I even use it at home. Red Hat’s Identity Management Guide is a great introduction to FreeIPA and will get you up … Read more