PostgreSQL on system with root as only user

Started by Fredrik Israelssonover 19 years ago12 messagesgeneral
Jump to latest
#1Fredrik Israelsson
fredrik.israelsson@eu.biotage.com

Hi!
I am about to install PostgreSQL on a minimal Linux system, where root
is the only user that is allowed to exist. I would prefer to use a
binary installer. Is it possible to install PostgreSQL without the
postgres user?

/Fredrik

#2Harpreet Dhaliwal
harpreet.dhaliwal01@gmail.com
In reply to: Fredrik Israelsson (#1)
Re: PostgreSQL on system with root as only user

No, you can't.
You need postgres user for sure.
Postgresql database doesn't run on root account.

~Harpreet

Show quoted text

On 8/30/06, Fredrik Israelsson <fredrik.israelsson@eu.biotage.com> wrote:

Hi!
I am about to install PostgreSQL on a minimal Linux system, where root
is the only user that is allowed to exist. I would prefer to use a
binary installer. Is it possible to install PostgreSQL without the
postgres user?

/Fredrik

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

#3Chris Mair
chrisnospam@1006.org
In reply to: Fredrik Israelsson (#1)
Re: PostgreSQL on system with root as only user

I am about to install PostgreSQL on a minimal Linux system, where root
is the only user that is allowed to exist. I would prefer to use a
binary installer. Is it possible to install PostgreSQL without the
postgres user?

PostgreSQL refuses to start up as root user for security
reasons (this is a feature).

If you know what you're doing and you want to disable that
feature you need to recompile from source and disable the
uid checks in src/backend/main/main.c.

Unless you're working in the embedded space or some such thing,
I don't think it's a good idea, anyway.

Bye :)
Chris.

--

Chris Mair
http://www.1006.org

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Fredrik Israelsson (#1)
Re: PostgreSQL on system with root as only user

"Fredrik Israelsson" <fredrik.israelsson@eu.biotage.com> writes:

I am about to install PostgreSQL on a minimal Linux system, where root
is the only user that is allowed to exist.

You've *got* to be kidding. That's possibly the stupidest system design
decision I've ever heard ... what is the point of disallowing non-root
userids? It certainly can't improve system security to run everything
as root.

regards, tom lane

#5Fredrik Israelsson
fredrik.israelsson@eu.biotage.com
In reply to: Tom Lane (#4)
Re: PostgreSQL on system with root as only user

Well, no actual "design decision" is made yet. Just testing...

...actually, in embedded, minimalistic environments, I don't think it's
unusual to have one and only one user.

/Fredrik

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: den 30 augusti 2006 15:17
To: Fredrik Israelsson
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] PostgreSQL on system with root as only user

"Fredrik Israelsson" <fredrik.israelsson@eu.biotage.com> writes:

I am about to install PostgreSQL on a minimal Linux system, where root

is the only user that is allowed to exist.

You've *got* to be kidding. That's possibly the stupidest system design
decision I've ever heard ... what is the point of disallowing non-root
userids? It certainly can't improve system security to run everything
as root.

regards, tom lane

#6Andrew Kelly
akelly@corisweb.org
In reply to: Tom Lane (#4)
Re: PostgreSQL on system with root as only user

On Wed, 2006-08-30 at 09:17 -0400, Tom Lane wrote:

"Fredrik Israelsson" <fredrik.israelsson@eu.biotage.com> writes:

I am about to install PostgreSQL on a minimal Linux system, where root
is the only user that is allowed to exist.

You've *got* to be kidding. That's possibly the stupidest system design
decision I've ever heard ... what is the point of disallowing non-root
userids? It certainly can't improve system security to run everything
as root.

Remember the glory of heaven and earth before man was created?

;-)

Show quoted text

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

#7Martijn van Oosterhout
kleptog@svana.org
In reply to: Fredrik Israelsson (#5)
Re: PostgreSQL on system with root as only user

On Wed, Aug 30, 2006 at 03:34:22PM +0200, Fredrik Israelsson wrote:

Well, no actual "design decision" is made yet. Just testing...

...actually, in embedded, minimalistic environments, I don't think it's
unusual to have one and only one user.

Yeah, but in embedded minimalisatic POSIX-compatable environment, I
imagine multiple users are somewhat of a requirement. It's not like a
UID costs anything, it's just a number...

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

From each according to his ability. To each according to his ability to litigate.

#8A.M.
agentm@themactionfaction.com
In reply to: Chris Mair (#3)
Re: PostgreSQL on system with root as only user

On Aug 30, 2006, at 9:01 , Chris Mair wrote:

If you know what you're doing and you want to disable that
feature you need to recompile from source and disable the
uid checks in src/backend/main/main.c.

Unless you're working in the embedded space or some such thing,
I don't think it's a good idea, anyway.

Has anyone actually used PostgreSQL on an embedded system? I am
genuinely curious. How about db performance from a flash drive?

-M

#9Brandon Aiken
BAiken@winemantech.com
In reply to: A.M. (#8)
Re: PostgreSQL on system with root as only user

Unless it's a read-only database, I would never recommend using flash
media for an RDBMS.

Unless it's a small database, I would never recommend using USB as a
storage interface for an RDBMS.

--
Brandon Aiken
CS/IT Systems Engineer
-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of AgentM
Sent: Wednesday, August 30, 2006 10:42 AM
To: PostgreSQL General ML
Subject: Re: [GENERAL] PostgreSQL on system with root as only user

On Aug 30, 2006, at 9:01 , Chris Mair wrote:

If you know what you're doing and you want to disable that
feature you need to recompile from source and disable the
uid checks in src/backend/main/main.c.

Unless you're working in the embedded space or some such thing,
I don't think it's a good idea, anyway.

Has anyone actually used PostgreSQL on an embedded system? I am
genuinely curious. How about db performance from a flash drive?

-M

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

#10A.M.
agentm@themactionfaction.com
In reply to: Brandon Aiken (#9)
Re: PostgreSQL on system with root as only user

On Aug 30, 2006, at 12:03 , Brandon Aiken wrote:

Unless it's a read-only database, I would never recommend using flash
media for an RDBMS.

Well, it's an embedded device, so you can pretty much be certain that
it's not storing sales information. If the flash goes belly up, then
the device has failed anyway, so the lost info is the least of the
problems.

Unless it's a small database, I would never recommend using USB as a
storage interface for an RDBMS.

Why? Could you provide more details?

I would be interested in any performance numbers anyone has collected.

-M

#11Brandon Aiken
BAiken@winemantech.com
In reply to: A.M. (#10)
Re: PostgreSQL on system with root as only user

I haven't got any numbers (or a USB stick I can test with at the moment)
but USB is going to be a bottleneck for read and write performance.
Unless you're accessing very small amounts of data or running small
queries, I would expect performance to be pretty poor.

If your data set is so small, why do you need a full RDBMS instead of
flat data/text files or SQLite? If you're not concerned about disk
media failure, why do you need a transactional DB? It seems like
putting a deadbolt on a screen door.

It might work just great for your device, of course, but I would not
expect it to scale well at all.

--
Brandon Aiken
CS/IT Systems Engineer

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of AgentM
Sent: Wednesday, August 30, 2006 1:21 PM
To: PostgreSQL General ML
Subject: Re: [GENERAL] PostgreSQL on system with root as only user

On Aug 30, 2006, at 12:03 , Brandon Aiken wrote:

Unless it's a read-only database, I would never recommend using flash
media for an RDBMS.

Well, it's an embedded device, so you can pretty much be certain that
it's not storing sales information. If the flash goes belly up, then
the device has failed anyway, so the lost info is the least of the
problems.

Unless it's a small database, I would never recommend using USB as a
storage interface for an RDBMS.

Why? Could you provide more details?

I would be interested in any performance numbers anyone has collected.

-M

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

#12A.M.
agentm@themactionfaction.com
In reply to: Brandon Aiken (#11)
Re: PostgreSQL on system with root as only user

On Aug 30, 2006, at 13:58 , Brandon Aiken wrote:

I haven't got any numbers (or a USB stick I can test with at the
moment)
but USB is going to be a bottleneck for read and write performance.
Unless you're accessing very small amounts of data or running small
queries, I would expect performance to be pretty poor.

Indeed, that's pretty much our scenario- a rack-mounted Linux box
storing mostly inconsequential data (auth creds) with a flash drive-
quasi-embedded, I guess.

If your data set is so small, why do you need a full RDBMS instead of
flat data/text files or SQLite? If you're not concerned about disk
media failure, why do you need a transactional DB? It seems like
putting a deadbolt on a screen door.

MySQL and SQLite have terrible concurrent performance with
transactions. We would also like to take advantage of database-level
replication instead of our fragile home-grown thing for load-sharing
and failover.

It might work just great for your device, of course, but I would not
expect it to scale well at all.

There are some things I can do- for example, fsync should probably
just be off. I guess I should simply go ahead and try it. Thanks for
the discussion!

-M