Re: [GENERAL] Post Install / Secure PostgreSQL

2010-10-07 Thread Greg Smith
Alan Hodgson wrote: The default setup allows "trust" access which means it trusts local system accounts to login as the same roles in Pg without specifying a password. There's two small inaccuracies with how you're describing this part. First, having "trust" be the default is the case for

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-15 Thread Craig Ringer
On 16/09/2010 2:10 AM, Carlos Mennens wrote: postgres=# SELECT * FROM pg_user; Doesn't that show I'm connected to the 'postgres' database and there is a table called 'pg_user' which holds all my PostgreSQL user info? That doesn't make sense to me if the database is empty unless I am missing s

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-15 Thread Tom Lane
Alan Hodgson writes: > On September 15, 2010 11:10:45 am Carlos Mennens wrote: >> Doesn't that show I'm connected to the 'postgres' database and there >> is a table called 'pg_user' which holds all my PostgreSQL user info? >> That doesn't make sense to me if the database is empty unless I am >> mi

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-15 Thread John R Pierce
On 09/15/10 11:10 AM, Carlos Mennens wrote: On Wed, Sep 15, 2010 at 1:43 PM, John R Pierce wrote: the 'postgres' database on your system is empty. this is quite typical, as that database is simply a convenience for the postgres user to have something to log into while doing his administrati

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-15 Thread Alan Hodgson
On September 15, 2010 11:10:45 am Carlos Mennens wrote: > Doesn't that show I'm connected to the 'postgres' database and there > is a table called 'pg_user' which holds all my PostgreSQL user info? > That doesn't make sense to me if the database is empty unless I am > missing something here. The on

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-15 Thread Carlos Mennens
On Wed, Sep 15, 2010 at 1:43 PM, John R Pierce wrote: > the 'postgres' database on your system is empty.   this is quite typical, as > that database is simply a convenience for the postgres user to have > something to log into while doing his administrative duties. OK this makes sense and I coul

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-15 Thread Tom Lane
John R Pierce writes: > On 09/15/10 10:00 AM, Carlos Mennens wrote: >> But when if 'cmennens' wants to login to PostgreSQL but not connect to >> any specific database? I know in MySQL you can login to the MySQL >> server CLI but not be attached to any specific database if you want to >> just pee

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-15 Thread Richard Broersma
On Wed, Sep 15, 2010 at 10:36 AM, Carlos Mennens wrote: > postgres=# \d > No relations found. > postgres=# \dt > No relations found. > postgres=# \c postgres > psql (8.4.4) > You are now connected to database "postgres". > postgres=# \dt > No relations found. > postgres=# \d try: select current

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-15 Thread David Wilson
On Wed, Sep 15, 2010 at 1:36 PM, Carlos Mennens wrote: > Thanks but then I am confused why I am getting the following: > You initially connected to the postgres database because you were logging in as the postgres user... > > postgres=# \d > No relations found. > postgres=# \dt > No relations f

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-15 Thread John R Pierce
On 09/15/10 10:36 AM, Carlos Mennens wrote: On Wed, Sep 15, 2010 at 1:34 PM, John R Pierce wrote: no, there is no such state in postgres. you connect and log into a database. connecting to a different database requires closing that connection and opening a new one (which is what the \c comma

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-15 Thread Carlos Mennens
On Wed, Sep 15, 2010 at 1:34 PM, John R Pierce wrote: > no, there is no such state in postgres.  you connect and log into a > database.  connecting to a different database requires closing that > connection and opening a new one (which is what the \c command does in > psql). Thanks but then I am

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-15 Thread John R Pierce
On 09/15/10 10:00 AM, Carlos Mennens wrote: But when if 'cmennens' wants to login to PostgreSQL but not connect to any specific database? I know in MySQL you can login to the MySQL server CLI but not be attached to any specific database if you want to just peek around and do basic administrative

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-15 Thread Carlos Mennens
Thanks all for the help! I have a much better understanding now of how user accounts are managed via ident authentication. The only thing I have yet to figure out or understand is how to login to PostgreSQL as my user account but not to any specific database. I understand that when I am logged in

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-14 Thread Craig Ringer
On 15/09/2010 12:50 AM, Carlos Mennens wrote: On Mon, Sep 13, 2010 at 9:58 PM, Craig Ringer wrote: craig$ sudo -u postgres psql postgres=> CREATE USER craig WITH PASSWORD 'somepassword' CREATEDB CREATEROLE; postgres=> CREATE DATABASE craig WITH OWNER craig; postgres=> \q So I s

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-14 Thread Carlos Mennens
On Tue, Sep 14, 2010 at 1:52 PM, Richard Broersma > You'd want to use "ALTER USER" > > http://www.postgresql.org/docs/8.4/interactive/sql-alteruser.html > > So: > > ALTER USER carlos WITH ENCRYPTED PASSWORD 'password'; I find it strange when I am logged in as super user 'postgres' and type the ex

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-14 Thread Richard Broersma
On Tue, Sep 14, 2010 at 9:50 AM, Carlos Mennens wrote: > Secondly I am unable to find any information in the docs that show me > how to set just the user password for 'carlos'. In MySQL I would use: > > SET PASSWORD FOR 'carlos'@'localhost' = PASSWORD('newpass'); You'd want to use "ALTER USER"

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-14 Thread Alan Hodgson
On September 14, 2010 09:50:30 am Carlos Mennens wrote: > Obviously there appears to be a specific password for both accounts > which I think are completely seperate from the Linux shell passwords, > right? PostgreSQL has internal passwords for roles which can be set with "alter role" or while cr

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-14 Thread Carlos Mennens
On Mon, Sep 13, 2010 at 9:58 PM, Craig Ringer wrote: > craig$ sudo -u postgres psql > postgres=> CREATE USER craig WITH PASSWORD 'somepassword' >           CREATEDB CREATEROLE; > postgres=> CREATE DATABASE craig WITH OWNER craig; > postgres=> \q So I set a Linux shell password on my newly auto cr

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-13 Thread Craig Ringer
On 14/09/2010 1:57 AM, Tom Lane wrote: I'd suggest creating "carlos" as either a plain user or a CREATEROLE user depending on whether you think you're likely to be adding/deleting plain users regularly. I'd second that. When I install a new instance of PostgreSQL, I usually set up a "craig" u

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-13 Thread Scott Marlowe
On Mon, Sep 13, 2010 at 12:24 PM, Carlos Mennens wrote: > On Mon, Sep 13, 2010 at 1:57 PM, Tom Lane wrote: > I also noticed that I created a database called 'ide' in PostgreSQL as > the 'postgres' super user and I am trying to change the owner of the > database to me and when I run the following

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-13 Thread Carlos Mennens
On Mon, Sep 13, 2010 at 1:57 PM, Tom Lane wrote: > It's definitely a good idea not to use a superuser account when you > don't have to; just like you don't use Unix root unless you have to. > You should do your day-to-day database hacking in an ordinary > unprivileged account. When I am logged in

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-13 Thread Tom Lane
Carlos Mennens writes: > In MySQL, it was recommended that you create a power user account > rather than manage the database with the 'root' account. Is this also > the same thing for PostgreSQL? I know you guys told me that there is > no 'root' account but there is a 'postgres' account which app

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-13 Thread Carlos Mennens
Thanks for all the assistance and clarification with my new install of PostgreSQL. I am able to switch users to 'postgres' and verify the default home directory for 'postgres' shell user: [r...@db1 ~]# su - postgres [postg...@db1 ~]$ pwd /var/lib/postgres I am also now able from the documentatio

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-13 Thread Sam Mason
On Fri, Sep 10, 2010 at 01:23:39PM -0700, bjjjrn lundin wrote: > I usually do like this on a new box > > sudo su - > su - postgres > createuser bnl > exit > exit It would be somewhat easier to use sudo's "-u" switch, the following should do the same as the above: sudo -u postgres createuser "$

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-10 Thread Craig Ringer
On 09/11/2010 01:39 AM, Arjen Nienhuis wrote: su - postgres psql -l If you didn't set a password for the postgres user it's actually: sudo su - postgres Better written, and less prone to being broken by odd shell setups, as: sudo -u postgres psql -- Craig Ringer -- Sent via pgsq

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-10 Thread Thomas Kellerer
Carlos Mennens wrote on 10.09.2010 17:53: On Fri, Sep 10, 2010 at 11:33 AM, Richard Broersma wrote: I don't believe there is a script like this. However, I would say that out of the box, PostgreSQL is so secure that some people cannot figure out how to log in. :) I agree and I am just now l

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-10 Thread björn lundin
>I can't seem to find out how > to login to the database. I am using 'psql -U root' however during my > installation there may have been a default password used which I am > not aware of. I need to read the docs and see how to login to the > database. I usually do like this on a new box sudo su -

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-10 Thread Arjen Nienhuis
>    su - postgres >    psql -l If you didn't set a password for the postgres user it's actually: sudo su - postgres -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-10 Thread David Fetter
On Fri, Sep 10, 2010 at 11:53:12AM -0400, Carlos Mennens wrote: > On Fri, Sep 10, 2010 at 11:33 AM, Richard Broersma > wrote: > > I don't believe there is a script like this.  However, I would say > > that out of the box, PostgreSQL is so secure that some people > > cannot figure out how to log in

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-10 Thread Carlos Mennens
On Fri, Sep 10, 2010 at 11:33 AM, Richard Broersma wrote: > I don't believe there is a script like this.  However, I would say > that out of the box, PostgreSQL is so secure that some people cannot > figure out how to log in. :) I agree and I am just now learning this. I can't seem to find out ho

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-10 Thread Tom Lane
Carlos Mennens writes: > I am brand new to PostgreSQL and coming from MySQL. My question is > does anyone know after I install PostgreSQL on my Linux server, is > there a script that secures the database like MySQL offers in most > Linux distributions? I think the script for MySQL is > "/usr/bin/m

Re: [GENERAL] Post Install / Secure PostgreSQL

2010-09-10 Thread Richard Broersma
On Fri, Sep 10, 2010 at 8:12 AM, Carlos Mennens wrote: > Do you guys know if this exist for PostgreSQL and or do you have any > suggestions for a fresh installation of PostgreSQL on Linux? I don't believe there is a script like this. However, I would say that out of the box, PostgreSQL is so se

[GENERAL] Post Install / Secure PostgreSQL

2010-09-10 Thread Carlos Mennens
I am brand new to PostgreSQL and coming from MySQL. My question is does anyone know after I install PostgreSQL on my Linux server, is there a script that secures the database like MySQL offers in most Linux distributions? I think the script for MySQL is "/usr/bin/mysql_secure_installation". I check