pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Help with privilege or pg_hba.conf
3+ messages / 3 participants
[nested] [flat]

* Help with privilege or pg_hba.conf
@ 2003-07-19 19:04 Arcadius A. <ahouans@sh.cvut.cz>
  2003-07-20 05:13 ` Re: Help with privilege or pg_hba.conf Ken Godee <ken@perfect-image.com>
  2003-07-20 11:07 ` Re: Help with privilege or pg_hba.conf Daniel Seichter <daniel@dseichter.de>
  0 siblings, 2 replies; 3+ messages in thread

From: Arcadius A. @ 2003-07-19 19:04 UTC (permalink / raw)
  To: pgsql-admin; +Cc: pgsql-general@postgresql.org

Hello!
I have a Unix box running PostgreSQL 7.3.3.

So far, I have been the only one user of the DB server...and I didn't have
any problem using it with the JDBC driver.

Now, a friend of mine wants to use the DB too for doing web stuffs(PHP,
JSP).... so I need to create a new user on PostgreSQL. this has been done
easily.
Now, I don't want the new user (his username is "cool",and he has a
password ) to access other DBs on my server... I want him to access ONLY a
database named "cool" that he owns
(as user "cool", I have created the DB "cool"... and I want  user "cool" to
access ONLY  DB "cool" and do any operation on it).

How can this be done?

I've been trying to modify "pg_hba.conf" but with no luck .... as user
"cool", after I connect to the DB server via psql and I do "\c anotherdb",
user "cool" can still connect to "anotherdb".
my "pg_hba.conf" can be found at http://ahouans.sh.cvut.cz/pg_hba.txt

Thanks in advance.

Have a nice weekend!

Arcadius Ahouansou.






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Help with privilege or pg_hba.conf
  2003-07-19 19:04 Help with privilege or pg_hba.conf Arcadius A. <ahouans@sh.cvut.cz>
@ 2003-07-20 05:13 ` Ken Godee <ken@perfect-image.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Ken Godee @ 2003-07-20 05:13 UTC (permalink / raw)
  To: Arcadius A. <ahouans@sh.cvut.cz>; +Cc: pgsql-general@postgresql.org

Arcadius A. wrote:
> Hello!
> I have a Unix box running PostgreSQL 7.3.3.
> 
> So far, I have been the only one user of the DB server...and I didn't have
> any problem using it with the JDBC driver.
> 
> Now, a friend of mine wants to use the DB too for doing web stuffs(PHP,
> JSP).... so I need to create a new user on PostgreSQL. this has been done
> easily.
> Now, I don't want the new user (his username is "cool",and he has a
> password ) to access other DBs on my server... I want him to access ONLY a
> database named "cool" that he owns
> (as user "cool", I have created the DB "cool"... and I want  user "cool" to
> access ONLY  DB "cool" and do any operation on it).
> 
> How can this be done?
> 
> I've been trying to modify "pg_hba.conf" but with no luck .... as user
> "cool", after I connect to the DB server via psql and I do "\c anotherdb",
> user "cool" can still connect to "anotherdb".
> my "pg_hba.conf" can be found at http://ahouans.sh.cvut.cz/pg_hba.txt
> 
> Thanks in advance.
> 
> Have a nice weekend!
> 
> Arcadius Ahouansou.

By creating a user "cool" you are allowing the user to connect to 
postgres and connect to any database.
Though any user may connect to a database, if they wish access to 
objects within that database they must have those privileges explicitly 
granted to them.
In other words if you didn't make "cool" a superuser (which you 
shouldn't of) or granted "cool" the right to create databases, "cool" 
will be able to connect to databases but that's it. "cool" won't be 
allowed to even select data or delete anything.
If you create a database and make "cool" the owner, "cool" can then do 
whatever with only that database.
As long as you create normal users you have to "Grant Privileges" to any 
new user to do anything, except connecting to databases.
Read up on, "creating users" and "Granting Privileges".
Or install the newest "pgaccess", it has a good gui for adding 
users/groups, displaying rights to objects and granting privileges.




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Help with privilege or pg_hba.conf
  2003-07-19 19:04 Help with privilege or pg_hba.conf Arcadius A. <ahouans@sh.cvut.cz>
@ 2003-07-20 11:07 ` Daniel Seichter <daniel@dseichter.de>
  1 sibling, 0 replies; 3+ messages in thread

From: Daniel Seichter @ 2003-07-20 11:07 UTC (permalink / raw)
  To: pgsql-admin; +Cc: pgsql-general@postgresql.org

Hello,

> I've been trying to modify "pg_hba.conf" but with no luck .... as user
> "cool", after I connect to the DB server via psql and I do "\c anotherdb",
> user "cool" can still connect to "anotherdb".
> my "pg_hba.conf" can be found at http://ahouans.sh.cvut.cz/pg_hba.txt
I think, you should not say, that all are allowed to connect to the database
and cool had to type in a password, because if cool is not cool, he also can
have access to all other databases, because the other lines said: ALL

At the moment I can't give a solution, but hopefully another person, because
I don't know exactly, if my answer is right (never needed restrict the
access to only one database)

Daniel Seichter
-- 
postgreSQL on Netware - the red elephant
http://postgresql.dseichter.org






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-07-20 11:07 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-07-19 19:04 Help with privilege or pg_hba.conf Arcadius A. <ahouans@sh.cvut.cz>
2003-07-20 05:13 ` Ken Godee <ken@perfect-image.com>
2003-07-20 11:07 ` Daniel Seichter <daniel@dseichter.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox