PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 31st, 2002, 04:00 PM
cliffyman cliffyman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Washington DC, USA
Posts: 156 cliffyman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 7 sec
Reputation Power: 13
Send a message via AIM to cliffyman
PostgreSQL Admin - passwords?

I just installed PostgreSQL 7.3.1 from source on RedHat 8.0. I have the system up, running and accessible from Unix sockets and TCP/IP. I can get into the system by doing the /usr/local/pgsql/bin/psql test command (as user postgres) or from my W2K box with pgAdmin2 (user: postgres and blank password) after I made changes to the pg_hba.conf file.

My question is, how do I make the system more secure by actually requiring real passwords?

(1) I can only get into the database from the shell by su'ing to the user postgres but it never asks for a password - is this okay?
(2) I want to make sure that when I connect via TCP/IP from my W2K box that a password is required as well.

Thanks for any security tips you guys might have.


-Cliff

Last edited by cliffyman : December 31st, 2002 at 04:04 PM.

Reply With Quote
  #2  
Old January 2nd, 2003, 05:20 AM
pmm pmm is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Sep 2002
Posts: 679 pmm User rank is Sergeant (500 - 2000 Reputation Level)pmm User rank is Sergeant (500 - 2000 Reputation Level)pmm User rank is Sergeant (500 - 2000 Reputation Level)pmm User rank is Sergeant (500 - 2000 Reputation Level)pmm User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 3 h 38 m 45 sec
Reputation Power: 17
Hi,

I came to this forum to post a similar question, so I will add to this thread. In reply to your first point, I can only su to postgres from root which I think is OK.
In order to get a PHP script to connect to a database, I had to set up "wwwrun" (the user that apache runs as on my system) as a user for postgres, using the "createuser" command, then grant permissions for this user.
But what worries me is, as you said, there is no password, so what is to stop anyone connecting to this database from a remote machine as the user "wwwrun"? I also couldn't define the host making the connection when granting permissions as you can in MySQL ( GRANT ..... TO user@localhost .....).
So - should I set a password for wwwrun? There must be a standard way making a connection in a secure way - could someone please point me in the right direction?
Hope this is some help to you - I found this tutorial helpful:
http://www-it.hive.no/database/pgsq...rial/intro.html

Reply With Quote
  #3  
Old January 2nd, 2003, 08:05 AM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 17
Send a message via AIM to rod k
Quote:
how do I make the system more secure by actually requiring real passwords
You have to edit pg_hba.conf to setup the requirements. You also set allowed hosts there, pmm.

Quote:
I can only get into the database from the shell by su'ing to the user postgres but it never asks for a password - is this okay?
No, it's not. Again, edit pg_hba.conf to require passwords. You will also need to give the postgres user a password with ALTER USER and be sure to give a password to any new users when using CREATE USER.
__________________
FSBO (For Sale By Owner) Realty

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > PostgreSQL Admin - passwords?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap