Thread: FATAL 1: SetUserId:
Hello, I have just installed the latest postgresql rpms on RedHat 5.1: root: rpm -q postgresql postgresql-6.3.2-4 root: rpm -q postgresql-data postgresql-data-6.3.2-4 However I can't get started with postgres as outlined in the tutorial: wuebben: psql template1 Connection to database 'template1' failed. FATAL 1: SetUserId: user "wuebben" is not in "pg_shadow" The postmaster is running: root: ps ax | grep post 580 p1 S 0:00 grep post 293 ? S 0:00 /usr/bin/postmaster -S -D/var/lib/pgsql Why is psql complaining ( and so are createdb and friends ) about: SetUserId: user "wuebben" is not in "pg_shadow" if psql is not even looking in /var/lib/pg_shadow ( see strace below )? What do I need to do to get started? The following doesn't work either ( for any user be it root or wuebben): root: psql -d template1 -c "create user wuebben" Connection to database 'template1' failed. FATAL 1: SetUserId: user "root" is not in "pg_shadow" I sincerley hope there is something wrong with the rpms, and not with the documenation. ;-) thanks! Bernd strace -etrace=open psql template1 > log.txt 2>&1 open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/local/qt/lib/libpq.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 3 open("/usr/lib/libpq.so.1", O_RDONLY) = 3 open("/usr/local/qt/lib/libcrypt.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) open("/lib/libcrypt.so.1", O_RDONLY) = 3 open("/usr/local/qt/lib/libnsl.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) open("/lib/libnsl.so.1", O_RDONLY) = 3 open("/usr/local/qt/lib/libdl.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) open("/lib/libdl.so.2", O_RDONLY) = 3 open("/usr/local/qt/lib/libm.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) open("/lib/libm.so.6", O_RDONLY) = 3 open("/usr/local/qt/lib/libreadline.so.3", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/libreadline.so.3", O_RDONLY) = 3 open("/usr/local/qt/lib/libhistory.so.3", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/libhistory.so.3", O_RDONLY) = 3 open("/usr/local/qt/lib/libtermcap.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) open("/lib/libtermcap.so.2", O_RDONLY) = 3 open("/usr/local/qt/lib/libncurses.so.4", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/libncurses.so.4", O_RDONLY) = 3 open("/usr/local/qt/lib/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) open("/lib/libc.so.6", O_RDONLY) = 3 open("/etc/nsswitch.conf", O_RDONLY) = 3 open("/usr/local/qt/lib/libnss_files.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) open("/lib/libnss_files.so.1", O_RDONLY) = 3 open("/etc/passwd", O_RDONLY) = 3 Connection to database 'template1' failed. FATAL 1: SetUserId: user "root" is not in "pg_shadow" -------------------------------------------------------------------- Bernd Johannes Wuebben wuebben@kde.org wuebben@math.cornell.edu wuebben@acm.org --------------------------------------------------------------------
On Wed, 12 Aug 1998, Bernd Johannes Wuebben wrote: > > Hello, > > I have just installed the latest postgresql rpms on RedHat 5.1: > > root: rpm -q postgresql > postgresql-6.3.2-4 > > root: rpm -q postgresql-data > postgresql-data-6.3.2-4 > > However I can't get started with postgres as outlined in the tutorial: > > wuebben: psql template1 > Connection to database 'template1' failed. > FATAL 1: SetUserId: user "wuebben" is not in "pg_shadow" Your $PGDATA/pg_hba.conf is probably telling pgsql to require a username/password for all databases. Go to the end of this file and change 'password' to 'trust', and then restart the postmaster. I guess this is an error in the rpm. > The postmaster is running: > > root: ps ax | grep post > 580 p1 S 0:00 grep post > 293 ? S 0:00 /usr/bin/postmaster -S -D/var/lib/pgsql > > > Why is psql complaining ( and so are createdb and friends ) about: > SetUserId: user "wuebben" is not in "pg_shadow" if psql is not even > looking in /var/lib/pg_shadow ( see strace below )? What do I need to > do to get started? It's not psql that is ocmplaining, it is the postmaster, so you're stracing the wrong program... I'll be graduating in very short notice, and I think I'l have a few spare days after that that I can use to write something about how postgres deals with users etc... Maarten _____________________________________________________________________________ | TU Delft, The Netherlands, Faculty of Information Technology and Systems | | Department of Electrical Engineering | | Computer Architecture and Digital Technique section | | M.Boekhold@et.tudelft.nl | -----------------------------------------------------------------------------
You can also try this As root: su - postgres createuser user_name this will probably allow your user to create and use databases. Maarten Boekhold wrote: > > On Wed, 12 Aug 1998, Bernd Johannes Wuebben wrote: > > > > > Hello, > > > > I have just installed the latest postgresql rpms on RedHat 5.1: > > > > root: rpm -q postgresql > > postgresql-6.3.2-4 > > > > root: rpm -q postgresql-data > > postgresql-data-6.3.2-4 > > > > However I can't get started with postgres as outlined in the tutorial: > > > > wuebben: psql template1 > > Connection to database 'template1' failed. > > FATAL 1: SetUserId: user "wuebben" is not in "pg_shadow" > > Your $PGDATA/pg_hba.conf is probably telling pgsql to require a > username/password for all databases. Go to the end of this file and > change 'password' to 'trust', and then restart the postmaster. I guess > this is an error in the rpm. > > > The postmaster is running: > > > > root: ps ax | grep post > > 580 p1 S 0:00 grep post > > 293 ? S 0:00 /usr/bin/postmaster -S -D/var/lib/pgsql > > > > > > Why is psql complaining ( and so are createdb and friends ) about: > > SetUserId: user "wuebben" is not in "pg_shadow" if psql is not even > > looking in /var/lib/pg_shadow ( see strace below )? What do I need to > > do to get started? > > It's not psql that is ocmplaining, it is the postmaster, so you're > stracing the wrong program... > > I'll be graduating in very short notice, and I think I'l have a few spare > days after that that I can use to write something about how postgres deals > with users etc... > > Maarten > > _____________________________________________________________________________ > | TU Delft, The Netherlands, Faculty of Information Technology and Systems | > | Department of Electrical Engineering | > | Computer Architecture and Digital Technique section | > | M.Boekhold@et.tudelft.nl | > ----------------------------------------------------------------------------- -- --Marcio Macedo Conectiva
On Thu, 13 Aug 1998, Marcio Macedo wrote: > You can also try this > As root: > su - postgres > createuser user_name > this will probably allow your user to create and use databases. Not is postgresql is configured to use password authentication. If it is configured to do so it couldn't care less which UNIX user you are. Maarten _____________________________________________________________________________ | TU Delft, The Netherlands, Faculty of Information Technology and Systems | | Department of Electrical Engineering | | Computer Architecture and Digital Technique section | | M.Boekhold@et.tudelft.nl | -----------------------------------------------------------------------------
On 13-Aug-98 Maarten Boekhold wrote: >> wuebben: psql template1 >> Connection to database 'template1' failed. >> FATAL 1: SetUserId: user "wuebben" is not in "pg_shadow" > > Your $PGDATA/pg_hba.conf is probably telling pgsql to require a > username/password for all databases. Go to the end of this file and > change 'password' to 'trust', and then restart the postmaster. I guess > this is an error in the rpm. No, this is not the case, here are the last line of my var/lib/pgsql/pg_hba.conf : # By default, allow anything over UNIX domain sockets and localhost. local all trust host all 127.0.0.1 255.255.255.255 trust As you can see 'trust' is set. Bernd -------------------------------------------------------------------- Bernd Johannes Wuebben wuebben@kde.org wuebben@math.cornell.edu wuebben@acm.org --------------------------------------------------------------------
On 13-Aug-98 Marcio Macedo wrote: > You can also try this > As root: > su - postgres > createuser user_name > this will probably allow your user to create and use databases. This doesn't work either. But that is no surprice, here is the relevant line of my /etc/passwd : postgres:!!:100:233:PostgreSQL Server:/var/lib/pgsql:/bin/bash There is no password associated so I can NOT log in as postgres. Bernd -------------------------------------------------------------------- Bernd Johannes Wuebben wuebben@kde.org wuebben@math.cornell.edu wuebben@acm.org --------------------------------------------------------------------
Seems to me that all this security nonsense has come to a point where posgres is 100% safe but also 100% unusable ;-). Bernd On 13-Aug-98 Maarten Boekhold wrote: > On Thu, 13 Aug 1998, Marcio Macedo wrote: > >> You can also try this >> As root: >> su - postgres >> createuser user_name >> this will probably allow your user to create and use databases. > > Not is postgresql is configured to use password authentication. If it > is > configured to do so it couldn't care less which UNIX user you are. > > Maarten > > ________________________________________________________________________ > _____ >| TU Delft, The Netherlands, Faculty of Information Technology and >| Systems | >| Department of Electrical Engineering >| | >| Computer Architecture and Digital Technique section >| | >| M.Boekhold@et.tudelft.nl >| | > ------------------------------------------------------------------------ > ----- -------------------------------------------------------------------- Bernd Johannes Wuebben wuebben@kde.org wuebben@math.cornell.edu wuebben@acm.org --------------------------------------------------------------------
> > Seems to me that all this security nonsense has come to a point where > posgres is 100% safe but also 100% unusable ;-). > > Bernd That is funny. We do have a somewhat creeping featurism, though the stuff has not changed much in the recent releases. What should be changed/added/removed? -- Bruce Momjian | 830 Blythe Avenue maillist@candle.pha.pa.us | Drexel Hill, Pennsylvania 19026 + If your life is a hard drive, | (610) 353-9879(w) + Christ can be your backup. | (610) 853-3000(h)
On 13-Aug-98 Bruce Momjian wrote: > That is funny. We do have a somewhat creeping featurism, though the > stuff has not changed much in the recent releases. What should be > changed/added/removed? I am new to postgres and am abosultely not qualified to comment on that. All I want at this point is to get postgres to work.:-) My previous mails indicate the problems I am having. I did read the tuturial and much of the other documentation that is supplied with postgres, but I can't get started. It might well be that the problem is trivial or just a goof up of the rpm builder. So let's see what the problem is and how to resolve it. Once that's achieved we can think about improving the documentation or whatever else needs to be done ;-) thanks, Bernd > > > -- > Bruce Momjian | 830 Blythe Avenue > maillist@candle.pha.pa.us | Drexel Hill, Pennsylvania > 19026 > + If your life is a hard drive, | (610) 353-9879(w) > + Christ can be your backup. | (610) 853-3000(h) -------------------------------------------------------------------- Bernd Johannes Wuebben wuebben@kde.org wuebben@math.cornell.edu wuebben@acm.org --------------------------------------------------------------------
Hi, I am fairly new to Postgres, and had some installation problems similar to yours. I am also using Redhat 5.0 and installed the RPMs. Although this may not be the ideal workaround, it worked for me. When you ran initdb, it should have created a 'postgres' user for you. If you do not have the password for it, log it as 'root', then type 'passwd postgres' and enter a new password. Log out and log back in as postgres. Then "createuser username". You should be able to log out, and log back in as the user you created, then run "psql databasename" (provided you have already done a 'createdb databasename" as 'postgres'. Now, this will not give you access to having full rights to create, destroy, and edit databases. You must grant these accesses from the postgres account. In any case, just using this process, you can create a database and tables in postgres and give SELECT, INSERT, and UPDATE access to your user by typing --> GRANT ALL ON databasename TO username --> \g I did this with username 'nobody' to give my Apache server access to the database. The RPM for Redhat 5.0 sets up Postmaster with TCP/IP connectivity, so you don't have to worry about it. Hope that helps. If it doesn't, let me know where it is failing and I will re-walk through my own Redhat RPM install. John Cook On Thu, 13 Aug 1998, Bernd Johannes Wuebben wrote: > > On 13-Aug-98 Bruce Momjian wrote: > > That is funny. We do have a somewhat creeping featurism, though the > > stuff has not changed much in the recent releases. What should be > > changed/added/removed? > > I am new to postgres and am abosultely not qualified to comment on that. > All I want at this point is to get postgres to work.:-) My previous mails > indicate the problems I am having. I did read the tuturial and much > of the other documentation that is supplied with postgres, but I can't > get started. > > It might well be that the problem is trivial or just a goof up of the > rpm builder. So let's see what the problem is and how to resolve it. > Once that's achieved we can think about improving the documentation or > whatever else needs to be done ;-) > > thanks, > Bernd > > > > > > > > -- > > Bruce Momjian | 830 Blythe Avenue > > maillist@candle.pha.pa.us | Drexel Hill, Pennsylvania > > 19026 > > + If your life is a hard drive, | (610) 353-9879(w) > > + Christ can be your backup. | (610) 853-3000(h) > > -------------------------------------------------------------------- > Bernd Johannes Wuebben wuebben@kde.org > wuebben@math.cornell.edu wuebben@acm.org > -------------------------------------------------------------------- > > >
This one's easy. Log on as root, edit /etc/psswd and remove !! Then log on as postgres and set your password. As for your other problem. It is an aggrivation belonging to RedHat and not PostgreSQL. You need to check your pam files, turn off shadow passwords or whatever your RedHat is using for user verification and add postmaster 5432 to your /etc/services. I never have probs with Slackware systems as a server but then again I don't worry about secure servers :-) RedHat is more secure, but the docs are either a little vague or so in depth that I don't have time to read them all and for the life of me I cannot remember what I did exactly to get my RedHat systems working properly. ( I'm not at those systems presently, and obviously :-) Consider blaming RedHat if you must blame or if you are frustrated getting it to work properly. By the way, Bernd, are you in Ithaca, NY ?? If so, do you know of any local user's group for Linux ?? On Thu, 13 Aug 1998 14:22:45 -0400 (EDT) Bernd Johannes Wuebben <wuebben@math.cornell.edu> writes: > >On 13-Aug-98 Marcio Macedo wrote: >> You can also try this >> As root: >> su - postgres >> createuser user_name >> this will probably allow your user to create and use databases. > >This doesn't work either. But that is no surprice, here is the >relevant line of my /etc/passwd : > >postgres:!!:100:233:PostgreSQL Server:/var/lib/pgsql:/bin/bash > >There is no password associated so I can NOT log in as postgres. > >Bernd >-------------------------------------------------------------------- >Bernd Johannes Wuebben wuebben@kde.org >wuebben@math.cornell.edu wuebben@acm.org >-------------------------------------------------------------------- _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]
On Thu, 13 Aug 1998, John C Cusick wrote: > Consider blaming RedHat if you must blame or if you are > frustrated getting it to work properly. Ok, I will give you suggestion a try. Oh, I didn't mean to blame anyone and certainly not the postgresql team. As I readily admitted in one of my mail, the fault might well lie with the rpm packager which is RedHat in this case. ;-) Then again RedHat is, whether we like it or not at least at this point still the number 1 linux distribution. If postgresql doesn't work out of the box on RedHat 5.1 using the RedHat 5.1 postgresql rpms that RedHat provided, then I think the postgresql team should know about it and react in some form or other and if it is just a friendly mail to the RedHat people telling them how to correct the situation. > By the way, Bernd, are you in Ithaca, NY ?? If so, do you > know of any local user's group for Linux ?? Yes, we do have a group here at Cornell. Why do you ask? Bernd
If you don't know how to drive a car then Ferrari F40 would be 100% save but also 100% unusable. *Gring* :) Bernd Johannes Wuebben wrote: > Seems to me that all this security nonsense has come to a point where > posgres is 100% safe but also 100% unusable ;-). > > Bernd > > On 13-Aug-98 Maarten Boekhold wrote: > > On Thu, 13 Aug 1998, Marcio Macedo wrote: > > > >> You can also try this > >> As root: > >> su - postgres > >> createuser user_name > >> this will probably allow your user to create and use databases. > > > > Not is postgresql is configured to use password authentication. If it > > is > > configured to do so it couldn't care less which UNIX user you are. > > > > Maarten > > > > ________________________________________________________________________ > > _____ > >| TU Delft, The Netherlands, Faculty of Information Technology and > >| Systems | > >| Department of Electrical Engineering > >| | > >| Computer Architecture and Digital Technique section > >| | > >| M.Boekhold@et.tudelft.nl > >| | > > ------------------------------------------------------------------------ > > ----- > > -------------------------------------------------------------------- > Bernd Johannes Wuebben wuebben@kde.org > wuebben@math.cornell.edu wuebben@acm.org > --------------------------------------------------------------------
On 14-Aug-98 Sejin Oh wrote: > If you don't know how to drive a car then Ferrari F40 would be 100% > save but > also 100% unusable. > > *Gring* :) Very funny -- if you claim to know how to drive a car then why don't you tell me how to get it into gear, rather than honoring us with your gratuitous comments. Bernd -------------------------------------------------------------------- Bernd Johannes Wuebben wuebben@kde.org wuebben@math.cornell.edu wuebben@acm.org --------------------------------------------------------------------
Hello John, thanks for your suggestion, On 13-Aug-98 JOHN COOK wrote: > > If you do not have the password for it, log it as 'root', then type > 'passwd postgres' and enter a new password. Log out and log back in as > postgres. Then "createuser username". You should be able to log out, root: su - postgres [postgres@petit pgsql]$ createuser wuebben Connection to database 'template1' failed. FATAL 1: SetUserId: user "postgres" is not in "pg_shadow" createuser: database access failed. [postgres@petit pgsql]$ but it still doesn't work. How do I get anyone into pg_shadow? Bernd -------------------------------------------------------------------- Bernd Johannes Wuebben wuebben@kde.org wuebben@math.cornell.edu wuebben@acm.org --------------------------------------------------------------------
On Thu, 13 Aug 1998, Bernd Johannes Wuebben wrote: > > On 13-Aug-98 Maarten Boekhold wrote: > >> wuebben: psql template1 > >> Connection to database 'template1' failed. > >> FATAL 1: SetUserId: user "wuebben" is not in "pg_shadow" > > > > Your $PGDATA/pg_hba.conf is probably telling pgsql to require a > > username/password for all databases. Go to the end of this file and > > change 'password' to 'trust', and then restart the postmaster. I guess > > this is an error in the rpm. > > No, this is not the case, here are the last line of my > var/lib/pgsql/pg_hba.conf : > > # By default, allow anything over UNIX domain sockets and localhost. > > local all trust > host all 127.0.0.1 255.255.255.255 trust > > As you can see 'trust' is set. I must have been asleep when I wrote that mail. PostgreSQL always requires a valid username. You should be able to connect to postgres when you're logged on as the UNIX user 'postgres' (ie. the postgresql superuser). Then you can create other users with 'createuser', or from within psql with 'CREATE USER'. Maarten _____________________________________________________________________________ | TU Delft, The Netherlands, Faculty of Information Technology and Systems | | Department of Electrical Engineering | | Computer Architecture and Digital Technique section | | M.Boekhold@et.tudelft.nl | -----------------------------------------------------------------------------
On Thu, 13 Aug 1998, Bernd Johannes Wuebben wrote: > > On 13-Aug-98 Marcio Macedo wrote: > > You can also try this > > As root: > > su - postgres > > createuser user_name > > this will probably allow your user to create and use databases. > > This doesn't work either. But that is no surprice, here is the > relevant line of my /etc/passwd : > > postgres:!!:100:233:PostgreSQL Server:/var/lib/pgsql:/bin/bash > > There is no password associated so I can NOT log in as postgres. Yes tou can. If you're root you can become *any* user *without* having passwords with 'su'. Maarten _____________________________________________________________________________ | TU Delft, The Netherlands, Faculty of Information Technology and Systems | | Department of Electrical Engineering | | Computer Architecture and Digital Technique section | | M.Boekhold@et.tudelft.nl | -----------------------------------------------------------------------------
Yow.... after this whole discussion, what was the final result Bernd ? did you get it? Here is one more question that you con check if not: look for the /var/lib/pgsql/base directory. if it is there, search for the Template1 directory inside it. if anyone of that exists try the folowing command as a POSTGRES user initdb --pgdata=/var/lib/pgsql --pglib=/usr/lib This will create a template1 database, which is a template to all databases that you'll create after. If all works create a new user (as postgres) with 'createuser' and a new db with 'createdb <dbname> 'command. I've been using redHat 5.1 with postgresql for some time, and it works quite fine as just as in Slackware, but it really has some issues about th rpm packages and its configuration. Well, I hope this work. But if not... let me know ok. Bernd Johannes Wuebben wrote: > > Hello John, > > thanks for your suggestion, > > On 13-Aug-98 JOHN COOK wrote: > > > > If you do not have the password for it, log it as 'root', then type > > 'passwd postgres' and enter a new password. Log out and log back in as > > postgres. Then "createuser username". You should be able to log out, > > root: su - postgres > [postgres@petit pgsql]$ createuser wuebben > Connection to database 'template1' failed. > FATAL 1: SetUserId: user "postgres" is not in "pg_shadow" > createuser: database access failed. > [postgres@petit pgsql]$ > > but it still doesn't work. How do I get anyone into pg_shadow? > > Bernd > > -------------------------------------------------------------------- > Bernd Johannes Wuebben wuebben@kde.org > wuebben@math.cornell.edu wuebben@acm.org > -------------------------------------------------------------------- -- --Marcio Macedo Conectiva