Re: Restrict access

Lists: pgsql-general
From: Michael Knudsen <micknudsen(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Restrict access
Date: 2007-08-02 12:35:30
Message-ID: 1186058130.245261.72800@l70g2000hse.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi,

I have created a database and imported a lot of data. I would like to
share this database with other people but they should not be able to
change anything. That is, they should only be allowed to use the
SELECT command.

If I create a user, this user can access the database and see the
names of all tables. I can now GRANT this user permission to use
SELECT on all tables. Apparently, this seems to solve the problem.
However, I have noticed that if people access the database using my
username (i.e. by typing "psql foo -u" and the providing my username)
they get full access. I have tried to disable this by "ALTER USER
username WITH PASSWORD 'password'" but that doesn't help. You still
don't need to supply any password.

I have used Google for several hours with coming even near a solution
so any help is appreaciated!

--
Michael Knudsen


From: Adam Witney <awitney(at)sgul(dot)ac(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Restrict access
Date: 2007-08-02 13:51:29
Message-ID: C2D79FF1.167ED%awitney@sgul.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 2/8/07 13:35, in article
1186058130(dot)245261(dot)72800(at)l70g2000hse(dot)googlegroups(dot)com, "Michael Knudsen"
<micknudsen(at)gmail(dot)com> wrote:

> Hi,
>
> I have created a database and imported a lot of data. I would like to
> share this database with other people but they should not be able to
> change anything. That is, they should only be allowed to use the
> SELECT command.
>
> If I create a user, this user can access the database and see the
> names of all tables. I can now GRANT this user permission to use
> SELECT on all tables. Apparently, this seems to solve the problem.
> However, I have noticed that if people access the database using my
> username (i.e. by typing "psql foo -u" and the providing my username)
> they get full access. I have tried to disable this by "ALTER USER
> username WITH PASSWORD 'password'" but that doesn't help. You still
> don't need to supply any password.
>
> I have used Google for several hours with coming even near a solution
> so any help is appreaciated!

Take a look at the pg_hba.conf in the PGDATA directory, you probably have
the connection set to 'trust'... Which won't require a password from that
connection location/type. You will need to run a "pg_ctl reload" to make any
changes take effect

HTH

Adam


From: Michael Knudsen <micknudsen(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Restrict access
Date: 2007-08-02 14:08:50
Message-ID: 1186063730.000714.305480@r34g2000hsd.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Aug 2, 3:51 pm, Adam Witney <awit(dot)(dot)(dot)(at)sgul(dot)ac(dot)uk> wrote:

> Take a look at the pg_hba.conf in the PGDATA directory, you probably have
> the connection set to 'trust'... Which won't require a password from that
> connection location/type. You will need to run a "pg_ctl reload" to make any
> changes take effect

I can't find a file with that name. I am not using postgreSQL on my
own computer, so the file may be hidden somewhere in a directory which
I haven't got access to. Is there another way to get rid of 'trust'?

--
Michael Knudsen


From: Michael Knudsen <micknudsen(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Restrict access
Date: 2007-08-03 07:31:30
Message-ID: 1186126290.221034.233930@o61g2000hsh.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Aug 2, 4:08 pm, Michael Knudsen <micknud(dot)(dot)(dot)(at)gmail(dot)com> wrote:

> I can't find a file with that name. I am not using postgreSQL on my
> own computer, so the file may be hidden somewhere in a directory which
> I haven't got access to. Is there another way to get rid of 'trust'?

Finally, I have managed to find the file, and everything works
perfectly. Thanks!

--
Michael Knudsen


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: Michael Knudsen <micknudsen(at)gmail(dot)com>
Subject: Re: Restrict access
Date: 2007-08-04 15:05:59
Message-ID: 200708041705.59832.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Michael Knudsen wrote:
> I can't find a file with that name. I am not using postgreSQL on my
> own computer, so the file may be hidden somewhere in a directory
> which I haven't got access to. Is there another way to get rid of
> 'trust'?

No.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/