ALT Linux sysadmins discussion
 help / color / mirror / Atom feed
* [Sysadmins] postgres
@ 2014-04-24 13:03 Anton Gorlov
  0 siblings, 0 replies; only message in thread
From: Anton Gorlov @ 2014-04-24 13:03 UTC (permalink / raw)
  To: ALT Linux sysadmin discuss

All - помогите с правами в postgres снятся с ручника.
Нужно запретит пользователям подключаться не к своим базам по дефолту.

postgres=# REVOKE CONNECT ON DATABASE template1 FROM PUBLIC;
REVOKE
postgres=# CREATE ROLE test NOSUPERUSER NOCREATEDB NOCREATEROLE 
NOINHERIT LOGIN ENCRYPTED PASSWORD 'test';
CREATE ROLE
postgres=# CREATE ROLE test2 NOSUPERUSER NOCREATEDB NOCREATEROLE 
NOINHERIT LOGIN ENCRYPTED PASSWORD 'test2';
CREATE ROLE
postgres=# CREATE DATABASE test2 WITH OWNER=test2;
CREATE DATABASE
postgres=# CREATE DATABASE test WITH OWNER=test;
CREATE DATABASE


psql -U test -W test
Пароль пользователя test:
psql (9.1.12)
Введите "help", чтобы получить справку.

test=> \q
psql -U test -W test2
Пароль пользователя test:
psql (9.1.12)
Введите "help", чтобы получить справку.

test2=>


Дёргать каждый раз REVOKE ALL ON DATABASE <DBNAME> FROM public;  не 
подходит. Нужно именно по дефолту  у public права урезать


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-04-24 13:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-24 13:03 [Sysadmins] postgres Anton Gorlov

ALT Linux sysadmins discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
		sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
	public-inbox-index sysadmins

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sysadmins


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git