pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Regarding access to a user
15+ messages / 7 participants
[nested] [flat]

* Regarding access to a user
@ 2008-08-20 06:41  Shashwat_Nigam <Shashwat_Nigam@satyam.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Shashwat_Nigam @ 2008-08-20 06:41 UTC (permalink / raw)
  To: pgsql-admin; +Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>; pgsql-general@postgresql.org <pgsql-general@postgresql.org>

Dear Team

First of all I would like to thank you to provide a spatial database fro GIS developers and user. But I have doubt in the usage. I have created a few databases (i.e. X, Y, Z)  in a default Server and I also created a user (i.e. Us). Now what I want is to set privilege that whenever the user log in as Us he can only see database Y, none other than that. The user Us could have all rights for database Y but can't  go for any other database (X or Z). I already tried for GRANT command but it doesn't seems to be fruitful as such.
Please provide some assistance regarding the same as it is very required for the further proceeding of my work.
Thanks & Regards,
Shashwat Nigam<mailto:shashwat_nigam@satyam.com>
| Software Engineer | Geographical Information System
Satyam Computer Services Limited<http://www.satyam.com/;, Hyderabad | MOBILE: +919951467324 |


________________________________
DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.

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

* Re: Regarding access to a user
@ 2008-08-20 13:10  Kevin Grittner <Kevin.Grittner@wicourts.gov>
  parent: Shashwat_Nigam <Shashwat_Nigam@satyam.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Kevin Grittner @ 2008-08-20 13:10 UTC (permalink / raw)
  To: pgsql-admin; Shashwat_Nigam <Shashwat_Nigam@satyam.com>; +Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>; pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>

>>> Shashwat_Nigam <Shashwat_Nigam@satyam.com> wrote: 
 
> Now what I want is to set privilege that whenever the user log in as
Us 
> he can only see database Y, none other than that. The user Us could
have all 
> rights for database Y but can't  go for any other database (X or Z).
 
The first thing you need to do is configure "host based
authentication":
 
http://www.postgresql.org/docs/8.3/interactive/auth-pg-hba-conf.html
 
Among other things, this allows you to restrict which users can
connect to which databases.
 
-Kevin



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

* Re: Regarding access to a user
@ 2008-08-21 08:53  Shashwat_Nigam <Shashwat_Nigam@satyam.com>
  parent: Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 3 replies; 15+ messages in thread

From: Shashwat_Nigam @ 2008-08-21 08:53 UTC (permalink / raw)
  To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>; pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>; pgsql-admin

Dear Kevin
Thanks for the help. But still the user is able to see all the databases. I defined something like this

# IPv4 local connections:
host    all         all         127.0.0.1/32          md5
host    HMRI_database   hmri    127.0.0.1/32          md5


in the above case hmri is user and HMRI_database. But still when user is log in as 'hmri' it is able to access all the databases.
Please provide a solution for the same.

Thanks & Regards,
Shashwat Nigam
| Software Engineer | Geographical Information System
Satyam Computer Services Limited, Hyderabad | MOBILE: +919951467324 |

-----Original Message-----
From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
Sent: Wednesday, August 20, 2008 6:41 PM
To: pgsql-admin@postgresql.org; Shashwat_Nigam
Cc: pgsql-general@postgresql.org; pgsql-sql@postgresql.org
Subject: Re: [ADMIN] Regarding access to a user

>>> Shashwat_Nigam <Shashwat_Nigam@satyam.com> wrote:

> Now what I want is to set privilege that whenever the user log in as
Us
> he can only see database Y, none other than that. The user Us could
have all
> rights for database Y but can't  go for any other database (X or Z).

The first thing you need to do is configure "host based
authentication":

http://www.postgresql.org/docs/8.3/interactive/auth-pg-hba-conf.html

Among other things, this allows you to restrict which users can
connect to which databases.

-Kevin


DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.



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

* Re: Regarding access to a user
@ 2008-08-21 08:59  Vishal Arora <aroravishal22@hotmail.com>
  parent: Shashwat_Nigam <Shashwat_Nigam@satyam.com>
  2 siblings, 1 reply; 15+ messages in thread

From: Vishal Arora @ 2008-08-21 08:59 UTC (permalink / raw)
  To: Shashwat_Nigam <shashwat_nigam@satyam.com>; +Cc: pgsql-admin





> From: Shashwat_Nigam@satyam.com> To: Kevin.Grittner@wicourts.gov> CC: pgsql-general@postgresql.org; pgsql-sql@postgresql.org; pgsql-admin@postgresql.org> Date: Thu, 21 Aug 2008 14:23:51 +0530> Subject: Re: [ADMIN] Regarding access to a user> > Dear Kevin> Thanks for the help. But still the user is able to see all the databases. I defined something like this> > # IPv4 local connections:> host all all 127.0.0.1/32 md5> host HMRI_database hmri 127.0.0.1/32 md5
You have to comment out the first entry made in your hba file. In this case it checks for the first line where all users are allowed to access all databases so it does not checks the second line.  
> > in the above case hmri is user and HMRI_database. But still when user is log in as 'hmri' it is able to access all the databases.> Please provide a solution for the same.> > Thanks & Regards,> Shashwat Nigam> | Software Engineer | Geographical Information System> Satyam Computer Services Limited, Hyderabad | MOBILE: +919951467324 |> > -----Original Message-----> From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]> Sent: Wednesday, August 20, 2008 6:41 PM> To: pgsql-admin@postgresql.org; Shashwat_Nigam> Cc: pgsql-general@postgresql.org; pgsql-sql@postgresql.org> Subject: Re: [ADMIN] Regarding access to a user> > >>> Shashwat_Nigam <Shashwat_Nigam@satyam.com> wrote:> > > Now what I want is to set privilege that whenever the user log in as> Us> > he can only see database Y, none other than that. The user Us could> have all> > rights for database Y but can't go for any other database (X or Z).> > The first thing you need to do is configure "host based> authentication":> > http://www.postgresql.org/docs/8.3/interactive/auth-pg-hba-conf.html; > Among other things, this allows you to restrict which users can> connect to which databases.> > -Kevin> > > DISCLAIMER:> This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.> > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)> To make changes to your subscription:> http://www.postgresql.org/mailpref/pgsql-admin
_________________________________________________________________
From salsa lessons to filmy gossip, news to music concerts - watch it all on MSN Video
http://video.msn.com/?mkt=en-in=

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

* Re: Regarding access to a user
@ 2008-08-21 09:05  Shashwat_Nigam <Shashwat_Nigam@satyam.com>
  parent: Vishal Arora <aroravishal22@hotmail.com>
  0 siblings, 2 replies; 15+ messages in thread

From: Shashwat_Nigam @ 2008-08-21 09:05 UTC (permalink / raw)
  To: Vishal Arora <aroravishal22@hotmail.com>; pgsql-admin; Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>; pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>; pgsql-admin

Dear Vishal
Thanks for the help but by doing this an error is generated at the time when the user is trying to log in  with the following message:
"
Access to database denied
The server doesn't grant access to the database: the server reports
FATAL: no pg_hba.conf entry for host "127.0.0.1", user "hmri", database "postgres", SSL off
To access a database on a PostgreSQL server, you first have to grant primary access to the server for your client (Host Based Authentication). PostgreSQL will check the pg_hba.conf file if a pattern that matches your client address / username / database is present and enabled before any SQL GRANT access control lists are evaluated.
The initial settings in pg_hba.conf are quite restrictive, in order to avoid unwanted security holes caused by unreviewed but mandatory system settings. You'll probably want to add something like
host all all 192.168.0.0/24 md5
This example grants MD5 encrypted password access to all databases to all users on the private network 192.168.0.0/24.
You can use the pg_hba.conf editor that is built into pgAdmin III to edit the pg_hba.conf configuration file. After changing pg_hba.conf, you need to trigger a server configuration reload using pg_ctl or by stopping and restarting the server process.
"
Please provide futher proceedings
Thanks & Regards,
Shashwat Nigam<mailto:shashwat_nigam@satyam.com>
| Software Engineer | Geographical Information System
Satyam Computer Services Limited<http://www.satyam.com/;, Hyderabad | MOBILE: +919951467324 |

From: Vishal Arora [mailto:aroravishal22@hotmail.com]
Sent: Thursday, August 21, 2008 2:29 PM
To: Shashwat_Nigam
Cc: pgsql-admin@postgresql.org
Subject: RE: [ADMIN] Regarding access to a user





________________________________

> From: Shashwat_Nigam@satyam.com
> To: Kevin.Grittner@wicourts.gov
> CC: pgsql-general@postgresql.org; pgsql-sql@postgresql.org; pgsql-admin@postgresql.org
> Date: Thu, 21 Aug 2008 14:23:51 +0530
> Subject: Re: [ADMIN] Regarding access to a user
>
> Dear Kevin
> Thanks for the help. But still the user is able to see all the databases. I defined something like this
>
> # IPv4 local connections:
> host all all 127.0.0.1/32 md5
> host HMRI_database hmri 127.0.0.1/32 md5

You have to comment out the first entry made in your hba file. In this case it checks for the first line where all users are allowed to access all databases so it does not checks the second line.

>
> in the above case hmri is user and HMRI_database. But still when user is log in as 'hmri' it is able to access all the databases.
> Please provide a solution for the same.
>
> Thanks & Regards,
> Shashwat Nigam
> | Software Engineer | Geographical Information System
> Satyam Computer Services Limited, Hyderabad | MOBILE: +919951467324 |
>
> -----Original Message-----
> From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
> Sent: Wednesday, August 20, 2008 6:41 PM
> To: pgsql-admin@postgresql.org; Shashwat_Nigam
> Cc: pgsql-general@postgresql.org; pgsql-sql@postgresql.org
> Subject: Re: [ADMIN] Regarding access to a user
>
> >>> Shashwat_Nigam <Shashwat_Nigam@satyam.com> wrote:
>
> > Now what I want is to set privilege that whenever the user log in as
> Us
> > he can only see database Y, none other than that. The user Us could
> have all
> > rights for database Y but can't go for any other database (X or Z).
>
> The first thing you need to do is configure "host based
> authentication":
>
> http://www.postgresql.org/docs/8.3/interactive/auth-pg-hba-conf.html
>
> Among other things, this allows you to restrict which users can
> connect to which databases.
>
> -Kevin
>
>
> DISCLAIMER:
> This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin

________________________________
Search for videos of Bollywood, Hollywood, Mollywood and every other wood, only on Live.com Try it now!<http://www.live.com/?scope=video&form=MICOAL;

________________________________
DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.

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

* Re: Regarding access to a user
@ 2008-08-21 09:07  Tomasz Ostrowski <tometzky@batory.org.pl>
  parent: Shashwat_Nigam <Shashwat_Nigam@satyam.com>
  2 siblings, 1 reply; 15+ messages in thread

From: Tomasz Ostrowski @ 2008-08-21 09:07 UTC (permalink / raw)
  To: Shashwat_Nigam <Shashwat_Nigam@satyam.com>; +Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>; pgsql-admin

On 2008-08-21 10:53, Shashwat_Nigam wrote:

> host    all         all         127.0.0.1/32          md5
> host    HMRI_database   hmri    127.0.0.1/32          md5
> in the above case hmri is user and HMRI_database. But still when user
> is log in as 'hmri' it is able to access all the databases.

Order matters:
host    HMRI_database   hmri    127.0.0.1/32          md5
host    all         all         127.0.0.1/32          md5

Regards
Tometzky
-- 
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
                                                      Winnie the Pooh



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

* Re: Regarding access to a user
@ 2008-08-21 09:12  Shashwat_Nigam <Shashwat_Nigam@satyam.com>
  parent: Tomasz Ostrowski <tometzky@batory.org.pl>
  0 siblings, 2 replies; 15+ messages in thread

From: Shashwat_Nigam @ 2008-08-21 09:12 UTC (permalink / raw)
  To: Tomasz Ostrowski <tometzky@batory.org.pl>; +Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>; pgsql-admin

Dear Tomasz
I had done the same but still the problem is like that the user is able to access all the databases in the current server. Even the order is like same and if I comment the second line(all access) then the error is there.
Please provide solution for the same.

Thanks & Regards,
Shashwat Nigam
| Software Engineer | Geographical Information System
Satyam Computer Services Limited, Hyderabad | MOBILE: +919951467324 |


-----Original Message-----
From: Tomasz Ostrowski [mailto:tometzky@batory.org.pl]
Sent: Thursday, August 21, 2008 2:37 PM
To: Shashwat_Nigam
Cc: pgsql-general@postgresql.org; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Regarding access to a user

On 2008-08-21 10:53, Shashwat_Nigam wrote:

> host    all         all         127.0.0.1/32          md5
> host    HMRI_database   hmri    127.0.0.1/32          md5
> in the above case hmri is user and HMRI_database. But still when user
> is log in as 'hmri' it is able to access all the databases.

Order matters:
host    HMRI_database   hmri    127.0.0.1/32          md5
host    all         all         127.0.0.1/32          md5

Regards
Tometzky
--
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
                                                      Winnie the Pooh


DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.



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

* Re: Regarding access to a user
@ 2008-08-21 09:16  Vishal Arora <aroravishal22@hotmail.com>
  parent: Shashwat_Nigam <Shashwat_Nigam@satyam.com>
  1 sibling, 1 reply; 15+ messages in thread

From: Vishal Arora @ 2008-08-21 09:16 UTC (permalink / raw)
  To: Shashwat_Nigam <shashwat_nigam@satyam.com>; pgsql-admin

Hi Shashwat, 
 
I presume your user is hmri and the database is hmri_database, is it correct?
 
if yes - your pg_hba.conf entry should be as following (if you are connecting to postgres on the same machine)
host hmri_database hmri 127.0.0.1/32 md5
 
Can you tell me what command are you using to connect to the server and what environment is it?
 
Regards
 
Vishal 



From: Shashwat_Nigam@satyam.comTo: aroravishal22@hotmail.com; pgsql-admin@postgresql.org; Kevin.Grittner@wicourts.govCC: pgsql-general@postgresql.org; pgsql-sql@postgresql.org; pgsql-admin@postgresql.orgDate: Thu, 21 Aug 2008 14:35:43 +0530Subject: Re: [ADMIN] Regarding access to a user






Dear Vishal 
Thanks for the help but by doing this an error is generated at the time when the user is trying to log in  with the following message:
“
Access to database denied
The server doesn't grant access to the database: the server reports 
FATAL: no pg_hba.conf entry for host "127.0.0.1", user "hmri", database "postgres", SSL off 
To access a database on a PostgreSQL server, you first have to grant primary access to the server for your client (Host Based Authentication). PostgreSQL will check the pg_hba.conf file if a pattern that matches your client address / username / database is present and enabled before any SQL GRANT access control lists are evaluated. 
The initial settings in pg_hba.conf are quite restrictive, in order to avoid unwanted security holes caused by unreviewed but mandatory system settings. You'll probably want to add something like 
host all all 192.168.0.0/24 md5 
This example grants MD5 encrypted password access to all databases to all users on the private network 192.168.0.0/24. 
You can use the pg_hba.conf editor that is built into pgAdmin III to edit the pg_hba.conf configuration file. After changing pg_hba.conf, you need to trigger a server configuration reload using pg_ctl or by stopping and restarting the server process.
“
Please provide futher proceedings

Thanks & Regards,
Shashwat Nigam
| Software Engineer | Geographical Information System
Satyam Computer Services Limited, Hyderabad | MOBILE: +919951467324 | 
 


From: Vishal Arora [mailto:aroravishal22@hotmail.com] Sent: Thursday, August 21, 2008 2:29 PMTo: Shashwat_NigamCc: pgsql-admin@postgresql.orgSubject: RE: [ADMIN] Regarding access to a user
 




> From: Shashwat_Nigam@satyam.com> To: Kevin.Grittner@wicourts.gov> CC: pgsql-general@postgresql.org; pgsql-sql@postgresql.org; pgsql-admin@postgresql.org> Date: Thu, 21 Aug 2008 14:23:51 +0530> Subject: Re: [ADMIN] Regarding access to a user> > Dear Kevin> Thanks for the help. But still the user is able to see all the databases. I defined something like this> > # IPv4 local connections:> host all all 127.0.0.1/32 md5> host HMRI_database hmri 127.0.0.1/32 md5You have to comment out the first entry made in your hba file. In this case it checks for the first line where all users are allowed to access all databases so it does not checks the second line.  > > in the above case hmri is user and HMRI_database. But still when user is log in as 'hmri' it is able to access all the databases.> Please provide a solution for the same.> > Thanks & Regards,> Shashwat Nigam> | Software Engineer | Geographical Information System> Satyam Computer Services Limited, Hyderabad | MOBILE: +919951467324 |> > -----Original Message-----> From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]> Sent: Wednesday, August 20, 2008 6:41 PM> To: pgsql-admin@postgresql.org; Shashwat_Nigam> Cc: pgsql-general@postgresql.org; pgsql-sql@postgresql.org> Subject: Re: [ADMIN] Regarding access to a user> > >>> Shashwat_Nigam <Shashwat_Nigam@satyam.com> wrote:> > > Now what I want is to set privilege that whenever the user log in as> Us> > he can only see database Y, none other than that. The user Us could> have all> > rights for database Y but can't go for any other database (X or Z).> > The first thing you need to do is configure "host based> authentication":> > http://www.postgresql.org/docs/8.3/interactive/auth-pg-hba-conf.html; > Among other things, this allows you to restrict which users can> connect to which databases.> > -Kevin> > > DISCLAIMER:> This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.> > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)> To make changes to your subscription:> http://www.postgresql.org/mailpref/pgsql-admin



Search for videos of Bollywood, Hollywood, Mollywood and every other wood, only on Live.com Try it now!

DISCLAIMER:This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
_________________________________________________________________
Searching for the best deals on travel? Visit MSN Travel.
http://msn.coxandkings.co.in/cnk/cnk.do=

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

* Re: Regarding access to a user
@ 2008-08-21 09:20  Tomasz Ostrowski <tometzky@batory.org.pl>
  parent: Shashwat_Nigam <Shashwat_Nigam@satyam.com>
  1 sibling, 0 replies; 15+ messages in thread

From: Tomasz Ostrowski @ 2008-08-21 09:20 UTC (permalink / raw)
  To: Shashwat_Nigam <Shashwat_Nigam@satyam.com>; +Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>; pgsql-admin

On 2008-08-21 11:12, Shashwat_Nigam wrote:

> I had done the same but still the problem is like that the user is
> able to access all the databases in the current server. Even the
> order is like same and if I comment the second line(all access) then
> the error is there.

You did issue "pg_ctl reload" or restart postgresql after making changes
to pg_hba.conf?

http://www.postgresql.org/docs/8.3/interactive/auth-pg-hba-conf.html
	The pg_hba.conf file is read on start-up and when the main
	server process receives a SIGHUP signal. If you edit the file
	on an active system, you will need to signal the server (using
	pg_ctl reload or kill -HUP) to make it re-read the file.

> Please provide solution for the same.

Please read the fine manual.

Regards
Tometzky
-- 
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
                                                      Winnie the Pooh



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

* Re: Regarding access to a user
@ 2008-08-21 09:25  Shashwat_Nigam <Shashwat_Nigam@satyam.com>
  parent: Vishal Arora <aroravishal22@hotmail.com>
  0 siblings, 1 reply; 15+ messages in thread

From: Shashwat_Nigam @ 2008-08-21 09:25 UTC (permalink / raw)
  To: Vishal Arora <aroravishal22@hotmail.com>; pgsql-admin; +Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>; pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>; pgsql-admin

Hi Vishal

Ya you are right and the order is same and the command is like that only.

I am opening it through pgAdmin only..
Thanks & Regards,
Shashwat Nigam<mailto:shashwat_nigam@satyam.com>
| Software Engineer | Geographical Information System
Satyam Computer Services Limited<http://www.satyam.com/;, Hyderabad | MOBILE: +919951467324 |

From: Vishal Arora [mailto:aroravishal22@hotmail.com]
Sent: Thursday, August 21, 2008 2:47 PM
To: Shashwat_Nigam; pgsql-admin@postgresql.org
Subject: RE: [ADMIN] Regarding access to a user


Hi Shashwat,

I presume your user is hmri and the database is hmri_database, is it correct?

if yes - your pg_hba.conf entry should be as following (if you are connecting to postgres on the same machine)


host hmri_database hmri 127.0.0.1/32 md5

Can you tell me what command are you using to connect to the server and what environment is it?


Regards

Vishal
________________________________

From: Shashwat_Nigam@satyam.com
To: aroravishal22@hotmail.com; pgsql-admin@postgresql.org; Kevin.Grittner@wicourts.gov
CC: pgsql-general@postgresql.org; pgsql-sql@postgresql.org; pgsql-admin@postgresql.org
Date: Thu, 21 Aug 2008 14:35:43 +0530
Subject: Re: [ADMIN] Regarding access to a user

Dear Vishal
Thanks for the help but by doing this an error is generated at the time when the user is trying to log in  with the following message:
"
Access to database denied
The server doesn't grant access to the database: the server reports
FATAL: no pg_hba.conf entry for host "127.0.0.1", user "hmri", database "postgres", SSL off
To access a database on a PostgreSQL server, you first have to grant primary access to the server for your client (Host Based Authentication). PostgreSQL will check the pg_hba.conf file if a pattern that matches your client address / username / database is present and enabled before any SQL GRANT access control lists are evaluated.
The initial settings in pg_hba.conf are quite restrictive, in order to avoid unwanted security holes caused by unreviewed but mandatory system settings. You'll probably want to add something like
host all all 192.168.0.0/24 md5
This example grants MD5 encrypted password access to all databases to all users on the private network 192.168.0.0/24.
You can use the pg_hba.conf editor that is built into pgAdmin III to edit the pg_hba.conf configuration file. After changing pg_hba.conf, you need to trigger a server configuration reload using pg_ctl or by stopping and restarting the server process.
"
Please provide futher proceedings
Thanks & Regards,
Shashwat Nigam<mailto:shashwat_nigam@satyam.com>
| Software Engineer | Geographical Information System
Satyam Computer Services Limited<http://www.satyam.com/;, Hyderabad | MOBILE: +919951467324 |

From: Vishal Arora [mailto:aroravishal22@hotmail.com]
Sent: Thursday, August 21, 2008 2:29 PM
To: Shashwat_Nigam
Cc: pgsql-admin@postgresql.org
Subject: RE: [ADMIN] Regarding access to a user




________________________________

> From: Shashwat_Nigam@satyam.com
> To: Kevin.Grittner@wicourts.gov
> CC: pgsql-general@postgresql.org; pgsql-sql@postgresql.org; pgsql-admin@postgresql.org
> Date: Thu, 21 Aug 2008 14:23:51 +0530
> Subject: Re: [ADMIN] Regarding access to a user
>
> Dear Kevin
> Thanks for the help. But still the user is able to see all the databases. I defined something like this
>
> # IPv4 local connections:
> host all all 127.0.0.1/32 md5
> host HMRI_database hmri 127.0.0.1/32 md5

You have to comment out the first entry made in your hba file. In this case it checks for the first line where all users are allowed to access all databases so it does not checks the second line.

>
> in the above case hmri is user and HMRI_database. But still when user is log in as 'hmri' it is able to access all the databases.
> Please provide a solution for the same.
>
> Thanks & Regards,
> Shashwat Nigam
> | Software Engineer | Geographical Information System
> Satyam Computer Services Limited, Hyderabad | MOBILE: +919951467324 |
>
> -----Original Message-----
> From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
> Sent: Wednesday, August 20, 2008 6:41 PM
> To: pgsql-admin@postgresql.org; Shashwat_Nigam
> Cc: pgsql-general@postgresql.org; pgsql-sql@postgresql.org
> Subject: Re: [ADMIN] Regarding access to a user
>
> >>> Shashwat_Nigam <Shashwat_Nigam@satyam.com> wrote:
>
> > Now what I want is to set privilege that whenever the user log in as
> Us
> > he can only see database Y, none other than that. The user Us could
> have all
> > rights for database Y but can't go for any other database (X or Z).
>
> The first thing you need to do is configure "host based
> authentication":
>
> http://www.postgresql.org/docs/8.3/interactive/auth-pg-hba-conf.html
>
> Among other things, this allows you to restrict which users can
> connect to which databases.
>
> -Kevin
>
>
> DISCLAIMER:
> This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
________________________________
Search for videos of Bollywood, Hollywood, Mollywood and every other wood, only on Live.com Try it now!<http://www.live.com/?scope=video&form=MICOAL;

________________________________
DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
________________________________
Searching for weekend getaways? Try Live.com Try it!<http://www.live.com/?scope=video&form=MICOAL;

________________________________
DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.

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

* Re: Regarding access to a user
@ 2008-08-21 09:39  Vishal Arora <aroravishal22@hotmail.com>
  parent: Shashwat_Nigam <Shashwat_Nigam@satyam.com>
  0 siblings, 0 replies; 15+ messages in thread

From: Vishal Arora @ 2008-08-21 09:39 UTC (permalink / raw)
  To: Shashwat_Nigam <shashwat_nigam@satyam.com>; pgsql-admin



From: Shashwat_Nigam@satyam.comTo: aroravishal22@hotmail.com; pgsql-admin@postgresql.orgCC: pgsql-general@postgresql.org; pgsql-sql@postgresql.org; pgsql-admin@postgresql.orgDate: Thu, 21 Aug 2008 14:55:05 +0530Subject: Re: [ADMIN] Regarding access to a user






Hi Vishal
 
Ya you are right and the order is same and the command is like that only. 
 
I am opening it through pgAdmin only..
 
If you are using pgAdmin, you have to keep maintainence db as postgres for which you do not have the entry for that in pg_hba file. I would suggest you to use psql -U <username> command line option to connect. 
 

Thanks & Regards,
Shashwat Nigam
| Software Engineer | Geographical Information System
Satyam Computer Services Limited, Hyderabad | MOBILE: +919951467324 | 
 


From: Vishal Arora [mailto:aroravishal22@hotmail.com] Sent: Thursday, August 21, 2008 2:47 PMTo: Shashwat_Nigam; pgsql-admin@postgresql.orgSubject: RE: [ADMIN] Regarding access to a user
 
Hi Shashwat,  I presume your user is hmri and the database is hmri_database, is it correct? if yes - your pg_hba.conf entry should be as following (if you are connecting to postgres on the same machine)host hmri_database hmri 127.0.0.1/32 md5 Can you tell me what command are you using to connect to the server and what environment is it? Regards Vishal 



From: Shashwat_Nigam@satyam.comTo: aroravishal22@hotmail.com; pgsql-admin@postgresql.org; Kevin.Grittner@wicourts.govCC: pgsql-general@postgresql.org; pgsql-sql@postgresql.org; pgsql-admin@postgresql.orgDate: Thu, 21 Aug 2008 14:35:43 +0530Subject: Re: [ADMIN] Regarding access to a user

Dear Vishal 
Thanks for the help but by doing this an error is generated at the time when the user is trying to log in  with the following message:
“
Access to database denied
The server doesn't grant access to the database: the server reports 
FATAL: no pg_hba.conf entry for host "127.0.0.1", user "hmri", database "postgres", SSL off 
To access a database on a PostgreSQL server, you first have to grant primary access to the server for your client (Host Based Authentication). PostgreSQL will check the pg_hba.conf file if a pattern that matches your client address / username / database is present and enabled before any SQL GRANT access control lists are evaluated. 
The initial settings in pg_hba.conf are quite restrictive, in order to avoid unwanted security holes caused by unreviewed but mandatory system settings. You'll probably want to add something like 
host all all 192.168.0.0/24 md5 
This example grants MD5 encrypted password access to all databases to all users on the private network 192.168.0.0/24. 
You can use the pg_hba.conf editor that is built into pgAdmin III to edit the pg_hba.conf configuration file. After changing pg_hba.conf, you need to trigger a server configuration reload using pg_ctl or by stopping and restarting the server process.
“
Please provide futher proceedings

Thanks & Regards,
Shashwat Nigam
| Software Engineer | Geographical Information System
Satyam Computer Services Limited, Hyderabad | MOBILE: +919951467324 | 
 


From: Vishal Arora [mailto:aroravishal22@hotmail.com] Sent: Thursday, August 21, 2008 2:29 PMTo: Shashwat_NigamCc: pgsql-admin@postgresql.orgSubject: RE: [ADMIN] Regarding access to a user
 




> From: Shashwat_Nigam@satyam.com> To: Kevin.Grittner@wicourts.gov> CC: pgsql-general@postgresql.org; pgsql-sql@postgresql.org; pgsql-admin@postgresql.org> Date: Thu, 21 Aug 2008 14:23:51 +0530> Subject: Re: [ADMIN] Regarding access to a user> > Dear Kevin> Thanks for the help. But still the user is able to see all the databases. I defined something like this> > # IPv4 local connections:> host all all 127.0.0.1/32 md5> host HMRI_database hmri 127.0.0.1/32 md5You have to comment out the first entry made in your hba file. In this case it checks for the first line where all users are allowed to access all databases so it does not checks the second line.  > > in the above case hmri is user and HMRI_database. But still when user is log in as 'hmri' it is able to access all the databases.> Please provide a solution for the same.> > Thanks & Regards,> Shashwat Nigam> | Software Engineer | Geographical Information System> Satyam Computer Services Limited, Hyderabad | MOBILE: +919951467324 |> > -----Original Message-----> From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]> Sent: Wednesday, August 20, 2008 6:41 PM> To: pgsql-admin@postgresql.org; Shashwat_Nigam> Cc: pgsql-general@postgresql.org; pgsql-sql@postgresql.org> Subject: Re: [ADMIN] Regarding access to a user> > >>> Shashwat_Nigam <Shashwat_Nigam@satyam.com> wrote:> > > Now what I want is to set privilege that whenever the user log in as> Us> > he can only see database Y, none other than that. The user Us could> have all> > rights for database Y but can't go for any other database (X or Z).> > The first thing you need to do is configure "host based> authentication":> > http://www.postgresql.org/docs/8.3/interactive/auth-pg-hba-conf.html; > Among other things, this allows you to restrict which users can> connect to which databases.> > -Kevin> > > DISCLAIMER:> This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.> > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)> To make changes to your subscription:> http://www.postgresql.org/mailpref/pgsql-admin



Search for videos of Bollywood, Hollywood, Mollywood and every other wood, only on Live.com Try it now!
 



DISCLAIMER:This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.



Searching for weekend getaways? Try Live.com Try it!

DISCLAIMER:This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
_________________________________________________________________
Searching for the best deals on travel? Visit MSN Travel.
http://msn.coxandkings.co.in/cnk/cnk.do=

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

* Re: [GENERAL] Regarding access to a user
@ 2008-08-21 12:03  Albe Laurenz <laurenz.albe@wien.gv.at>
  parent: Shashwat_Nigam <Shashwat_Nigam@satyam.com>
  2 siblings, 0 replies; 15+ messages in thread

From: Albe Laurenz @ 2008-08-21 12:03 UTC (permalink / raw)
  To: Shashwat_Nigam *EXTERN* <Shashwat_Nigam@satyam.com>; Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: pgsql-general@postgresql.org; pgsql-sql@postgresql.org; pgsql-admin

Shashwat_Nigam wrote:
> Thanks for the help. But still the user is able to see all 
> the databases. I defined something like this
> 
> # IPv4 local connections:
> host    all         all         127.0.0.1/32          md5
> host    HMRI_database   hmri    127.0.0.1/32          md5
> 
> 
> in the above case hmri is user and HMRI_database. But still 
> when user is log in as 'hmri' it is able to access all the databases.
> Please provide a solution for the same.

Remove the first line, and you'll be fine.

PostgreSQL uses the first line in pg_hba.conf that matches the
incoming connection.

Yours,
Laurenz Albe



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

* Re: Regarding access to a user
@ 2008-08-22 23:39  Lew <noone@lwsc.ehost-services.com>
  parent: Shashwat_Nigam <Shashwat_Nigam@satyam.com>
  1 sibling, 0 replies; 15+ messages in thread

From: Lew @ 2008-08-22 23:39 UTC (permalink / raw)
  To: pgsql-admin

Shashwat_Nigam wrote:
> Dear Tomasz

There are others here, too.

> I had done the same but still the problem is like that the user is able to access all the databases in the current server. Even the order is like same and if I comment the second line(all access) then the error is there.
> Please provide solution for the same.

It sounds like you didn't bump the server.  You have to signal it to re-read 
the pg_hba.conf file.  The link provided by Kevin Grittner

<http://www.postgresql.org/docs/8.3/interactive/auth-pg-hba-conf.html;

explains

> The pg_hba.conf file is read on start-up and when the main server process 
> receives a SIGHUP signal. If you edit the file on an active system, you will 
> need to signal the server (using pg_ctl reload or kill -HUP) to make it 
> re-read the file. 

Did you perform that step?

-- 
Lew



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

* Re: Regarding access to a user
@ 2008-08-25 17:08  Scott Marlowe <scott.marlowe@gmail.com>
  parent: Shashwat_Nigam <Shashwat_Nigam@satyam.com>
  1 sibling, 1 reply; 15+ messages in thread

From: Scott Marlowe @ 2008-08-25 17:08 UTC (permalink / raw)
  To: Shashwat_Nigam <Shashwat_Nigam@satyam.com>; +Cc: Vishal Arora <aroravishal22@hotmail.com>; pgsql-admin; Kevin Grittner <Kevin.Grittner@wicourts.gov>; pgsql-general@postgresql.org <pgsql-general@postgresql.org>; pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>

On Thu, Aug 21, 2008 at 3:05 AM, Shashwat_Nigam
<Shashwat_Nigam@satyam.com> wrote:
> Dear Vishal
>
> Thanks for the help but by doing this an error is generated at the time when
> the user is trying to log in  with the following message:
>
> "
>
> Access to database denied
>
> The server doesn't grant access to the database: the server reports
>
> FATAL: no pg_hba.conf entry for host "127.0.0.1", user "hmri", database
> "postgres", SSL off

Notice that it says database postgres???  User hmri doesn't have
permission to connect to the the postgres database.  you need to
connect to the hmri database.



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

* Re: Regarding access to a user
@ 2008-08-26 04:18  Vishal Arora <aroravishal22@hotmail.com>
  parent: Scott Marlowe <scott.marlowe@gmail.com>
  0 siblings, 0 replies; 15+ messages in thread

From: Vishal Arora @ 2008-08-26 04:18 UTC (permalink / raw)
  To: Scott Marlowe <scott.marlowe@gmail.com>; Shashwat_Nigam <shashwat_nigam@satyam.com>; +Cc: pgsql-admin; Kevin Grittner <kevin.grittner@wicourts.gov>; pgsql-general@postgresql.org <pgsql-general@postgresql.org>; pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>





> Date: Mon, 25 Aug 2008 11:08:14 -0600> From: scott.marlowe@gmail.com> To: Shashwat_Nigam@satyam.com> Subject: Re: [ADMIN] Regarding access to a user> CC: aroravishal22@hotmail.com; pgsql-admin@postgresql.org; Kevin.Grittner@wicourts.gov; pgsql-general@postgresql.org; pgsql-sql@postgresql.org> > On Thu, Aug 21, 2008 at 3:05 AM, Shashwat_Nigam> <Shashwat_Nigam@satyam.com> wrote:> > Dear Vishal> >> > Thanks for the help but by doing this an error is generated at the time when> > the user is trying to log in with the following message:> >> > "> >> > Access to database denied> >> > The server doesn't grant access to the database: the server reports> >> > FATAL: no pg_hba.conf entry for host "127.0.0.1", user "hmri", database> > "postgres", SSL off> > Notice that it says database postgres??? User hmri doesn't have> permission to connect to the the postgres database. you need to> connect to the hmri database.
He is using PgAdmin III to connect to the database. When you use pgAdminIII, it has one text field as Maintainance DB - that is by default marked as Postgres. Now when you make entries for specific user for specific database, you get this above error, if you do not change the maintainence db to the same as the user wants to connect to. 
 
 
> 
> -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)> To make changes to your subscription:> http://www.postgresql.org/mailpref/pgsql-admin
_________________________________________________________________
From salsa lessons to filmy gossip, news to music concerts - watch it all on MSN Video
http://video.msn.com/?mkt=en-in=

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


end of thread, other threads:[~2008-08-26 04:18 UTC | newest]

Thread overview: 15+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-08-20 06:41 Regarding access to a user Shashwat_Nigam <Shashwat_Nigam@satyam.com>
2008-08-20 13:10 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
2008-08-21 08:53   ` Shashwat_Nigam <Shashwat_Nigam@satyam.com>
2008-08-21 08:59     ` Vishal Arora <aroravishal22@hotmail.com>
2008-08-21 09:05       ` Shashwat_Nigam <Shashwat_Nigam@satyam.com>
2008-08-21 09:16         ` Vishal Arora <aroravishal22@hotmail.com>
2008-08-21 09:25           ` Shashwat_Nigam <Shashwat_Nigam@satyam.com>
2008-08-21 09:39             ` Vishal Arora <aroravishal22@hotmail.com>
2008-08-25 17:08         ` Scott Marlowe <scott.marlowe@gmail.com>
2008-08-26 04:18           ` Vishal Arora <aroravishal22@hotmail.com>
2008-08-21 09:07     ` Tomasz Ostrowski <tometzky@batory.org.pl>
2008-08-21 09:12       ` Shashwat_Nigam <Shashwat_Nigam@satyam.com>
2008-08-21 09:20         ` Tomasz Ostrowski <tometzky@batory.org.pl>
2008-08-22 23:39         ` Lew <noone@lwsc.ehost-services.com>
2008-08-21 12:03     ` Albe Laurenz <laurenz.albe@wien.gv.at>

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