[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-developers] HELP!



Hello,

I got the following instructions off the knowledge base for the RAQ3.  Does
this imply that any user on the server is what they refer to as "admin".
Then the root can come in and give that "admin" user access to the postgres
directories to create a database?  Would this mean that "admin" needs to
find a way to run initdb to create the original template1 or does it mean
that "admin" can now start using the createdb command?

Here is the instructions posted on the FAQ section:
The following process will give the postgres user called "admin" the
super-user privilage. Once this is done, a user can log into postgres using
the admin account and modify itself to allow creation of users and
databases.

1. telnet in as admin

2. use su - to switch to root

[admin@raq3 admin]$ su -
Password:
*****************************************************************

NOTICE TO ROOT USER: Changes to system files may affect
your warranty. Please consult your warranty card for details.

http://www.cobaltnet.com

*****************************************************************
[root@raq3 /root]#

3. use an editor and open the file /home/pgsql/pg_hba.conf

[root@raq3 /root]# vi /home/pgsql/pg_hba.conf

4. Change local all crypt to local all trust

5. use su to switch to the user ID postgres

[root@raq3 /root]# su postgres
[postgres@raq3 /root]$


6. Now run the psql program to connect to the database server.

[postgres@raq3 /root]$ psql cobalt
Welcome to the POSTGRESQL interactive sql monitor:
Please read the file COPYRIGHT for copyright terms of POSTGRESQL
[PostgreSQL 6.5.2 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66]

type ? for help on slash commands
type q to quit
type g or terminate with semicolon to execute query
You are currently connected to the database: cobalt

cobalt=>

7. Enter the following commands to give super-user privilage to admin and
quit.

cobalt=> update pg_shadow set usesuper='t' where usename='admin';
UPDATE 1
cobalt=> q
[postgres@raq3 /root]$

8. Use the exit command to become "root" again.

9. Now open the /home/pgsql/pg_hba.conf file and change "local all trust"
back to "local all crypt".

It is now possible to access postgres using the postgres account "admin".
The password for this account is stored in the file /etc/cobalt/.meta.id and
should not be changed. If the password needs to be changed, it must be
changed in the pg_shadow table and the /etc/cobalt/.meta.id file. Be sure to
maintain file permissions on the file or system security could be
compromised.