pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedPermission Denied When i am Trying to take Backup
11+ messages / 9 participants
[nested] [flat]
* Permission Denied When i am Trying to take Backup
@ 2001-10-10 12:00 ` Moovarkku Mudhalvan <mudhalvan@vasunas.com>
2001-10-10 12:14 ` Re: Permission Denied When i am Trying to take Backup Chris Ruprecht <chrup999@yahoo.com>
2001-10-10 12:55 ` Re: Permission Denied When i am Trying to take Backup Nick Fankhauser <nickf@ontko.com>
1 sibling, 2 replies; 11+ messages in thread
From: Moovarkku Mudhalvan @ 2001-10-10 12:00 UTC (permalink / raw)
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>; Nick Fankhauser <nickf@ontko.com>; +Cc: Laurette Cisneros <laurette@nextbus.com>; pgsql-admin
Hi Gurus,
Greetings. I am using Postgresql in Red hat linux 71. When i was trying
to take the backup it is giving the error "Permission Denied"
Did any one faced the Same problem.
I will tell u what are the things which i did
1. Login as root
2. su -l postgres
3. pg_dump databasename >filename
Where other things are working fine. Only when i was trying to take the
backup i am getting the problem. Please let me know some guidence
Thanks
Mudhalvan M.M
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Permission Denied When i am Trying to take Backup
2001-10-10 12:00 ` Permission Denied When i am Trying to take Backup Moovarkku Mudhalvan <mudhalvan@vasunas.com>
@ 2001-10-10 12:14 ` Chris Ruprecht <chrup999@yahoo.com>
1 sibling, 0 replies; 11+ messages in thread
From: Chris Ruprecht @ 2001-10-10 12:14 UTC (permalink / raw)
To: pgsql-admin
you should make sure, that you have 'rwx' access to the directory you're
trying to send the output to. Make sure, all your postgres files under the
postgres home (~postgres) as well as all directories are actually owned by
postgres. If they are not, this small script can change that:
cd ~postgres
find . -depth -exec chown postgres:postgres {} ";"
Best regards,
Chris
----- Original Message -----
From: "Moovarkku Mudhalvan" <mudhalvan@vasunas.com>
To: "Stephan Szabo" <sszabo@megazone23.bigpanda.com>; "Nick Fankhauser"
<nickf@ontko.com>
Cc: "Laurette Cisneros" <laurette@nextbus.com>; <pgsql-admin@postgresql.org>
Sent: Wednesday, October 10, 2001 7:00 AM
Subject: [ADMIN] Permission Denied When i am Trying to take Backup
> Hi Gurus,
>
> Greetings. I am using Postgresql in Red hat linux 71. When i was
trying
> to take the backup it is giving the error "Permission Denied"
> Did any one faced the Same problem.
> I will tell u what are the things which i did
>
> 1. Login as root
> 2. su -l postgres
> 3. pg_dump databasename >filename
>
> Where other things are working fine. Only when i was trying to take the
> backup i am getting the problem. Please let me know some guidence
>
> Thanks
> Mudhalvan M.M
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Permission Denied When i am Trying to take Backup
2001-10-10 12:00 ` Permission Denied When i am Trying to take Backup Moovarkku Mudhalvan <mudhalvan@vasunas.com>
@ 2001-10-10 12:55 ` Nick Fankhauser <nickf@ontko.com>
1 sibling, 0 replies; 11+ messages in thread
From: Nick Fankhauser @ 2001-10-10 12:55 UTC (permalink / raw)
To: Moovarkku Mudhalvan <mudhalvan@vasunas.com>; +Cc: pgsql-admin
Perhaps postgres doesn't have rights to create <filename> in the current
directory?
To test this, try to use the same procedure & at step 3, do: touch
<filename> instead of starting dump. If it fails, you have the answer.
What does the "-l" option on su do? (I'm unfamiliar with it & apparently
don't have such an option on the version I'm running.)
> -----Original Message-----
> From: Moovarkku Mudhalvan [mailto:mudhalvan@vasunas.com]
> Sent: Wednesday, October 10, 2001 7:01 AM
> To: Stephan Szabo; Nick Fankhauser
> Cc: Laurette Cisneros; pgsql-admin@postgresql.org
> Subject: Permission Denied When i am Trying to take Backup
>
>
> Hi Gurus,
>
> Greetings. I am using Postgresql in Red hat linux 71. When i
> was trying
> to take the backup it is giving the error "Permission Denied"
> Did any one faced the Same problem.
> I will tell u what are the things which i did
>
> 1. Login as root
> 2. su -l postgres
> 3. pg_dump databasename >filename
>
> Where other things are working fine. Only when i was trying to take the
> backup i am getting the problem. Please let me know some guidence
>
> Thanks
> Mudhalvan M.M
>
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Permission Denied When i am Trying to take Backup
@ 2001-10-10 12:24 ` Stefan Huber <looseleaf@gmx.net>
2001-10-11 20:03 ` Re: Permission Denied When i am Trying to take Backup Peter Eisentraut <peter_e@gmx.net>
2001-10-12 11:56 ` Re: Permission Denied When i am Trying to take Backup Stefan Huber <looseleaf@gmx.net>
1 sibling, 2 replies; 11+ messages in thread
From: Stefan Huber @ 2001-10-10 12:24 UTC (permalink / raw)
To: pgsql-admin
Hi!
> Greetings. I am using Postgresql in Red hat linux 71. When i was trying
>to take the backup it is giving the error "Permission Denied"
> 1. Login as root
> 2. su -l postgres
> 3. pg_dump databasename >filename
Who gives you the "Permission denied"? The shell? The postmaster? What is
the exact error message?
I guess, you dno't have permission to create a file as user postgres in the
directory you are working in.
If you followed the installatino guide step by step, the postgres
files/directories are owned by root, not by postgres. I always do a chown
-R postgres:daemon /usr/local/pgsql (or postgres:postgres) after installation.
Stefan
--
Cameron's Law:
An honest politician is one who, when he is bought, will stay bought.
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Permission Denied When i am Trying to take Backup
2001-10-10 12:24 ` Re: Permission Denied When i am Trying to take Backup Stefan Huber <looseleaf@gmx.net>
@ 2001-10-11 20:03 ` Peter Eisentraut <peter_e@gmx.net>
2001-10-12 12:33 ` Re: Permission Denied When i am Trying to take Backup postgresql <pgsql@symcom.com>
1 sibling, 1 reply; 11+ messages in thread
From: Peter Eisentraut @ 2001-10-11 20:03 UTC (permalink / raw)
To: Stefan Huber <looseleaf@gmx.net>; +Cc: pgsql-admin
Stefan Huber writes:
> If you followed the installatino guide step by step, the postgres
> files/directories are owned by root, not by postgres.
Which is a good idea.
> I always do a chown -R postgres:daemon /usr/local/pgsql (or
> postgres:postgres) after installation.
Which is a bad idea.
The installation instructions were developed with some thought behind
them.
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Permission Denied When i am Trying to take Backup
2001-10-10 12:24 ` Re: Permission Denied When i am Trying to take Backup Stefan Huber <looseleaf@gmx.net>
2001-10-11 20:03 ` Re: Permission Denied When i am Trying to take Backup Peter Eisentraut <peter_e@gmx.net>
@ 2001-10-12 12:33 ` postgresql <pgsql@symcom.com>
2001-10-12 17:53 ` Re: Permission Denied When i am Trying to take Backup Brett W. McCoy <bmccoy@chapelperilous.net>
2001-10-13 03:12 ` Re: Permission Denied When i am Trying to take Backup Stuart Bishop <zen@shangri-la.dropbear.id.au>
0 siblings, 2 replies; 11+ messages in thread
From: postgresql @ 2001-10-12 12:33 UTC (permalink / raw)
To: pgsql-admin
Could someone create a post that shows who(user) should own
what. I have always let postgres own the pgsql directory and I see
that it is recomended that root own it.
Thanks,
Ted
-----Original Message-----
From: Peter Eisentraut <peter_e@gmx.net>
To: Stefan Huber <looseleaf@gmx.net>
Date: Thu, 11 Oct 2001 22:03:28 +0200 (CEST)
Subject: Re: [ADMIN] Permission Denied When i am Trying to take
Backup
> Stefan Huber writes:
>
> > If you followed the installatino guide step by step, the postgres
> > files/directories are owned by root, not by postgres.
>
> Which is a good idea.
>
> > I always do a chown -R postgres:daemon /usr/local/pgsql (or
> > postgres:postgres) after installation.
>
> Which is a bad idea.
>
> The installation instructions were developed with some thought
behind
> them.
>
> --
> Peter Eisentraut peter_e@gmx.net
http://funkturm.homeip.net/~peter
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an
appropriate
> subscribe-nomail command to majordomo@postgresql.org so
that your
> message can get through to the mailing list cleanly
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Permission Denied When i am Trying to take Backup
2001-10-10 12:24 ` Re: Permission Denied When i am Trying to take Backup Stefan Huber <looseleaf@gmx.net>
2001-10-11 20:03 ` Re: Permission Denied When i am Trying to take Backup Peter Eisentraut <peter_e@gmx.net>
2001-10-12 12:33 ` Re: Permission Denied When i am Trying to take Backup postgresql <pgsql@symcom.com>
@ 2001-10-12 17:53 ` Brett W. McCoy <bmccoy@chapelperilous.net>
1 sibling, 0 replies; 11+ messages in thread
From: Brett W. McCoy @ 2001-10-12 17:53 UTC (permalink / raw)
To: postgresql <pgsql@symcom.com>; +Cc: pgsql-admin
On Fri, 12 Oct 2001, postgresql wrote:
> Could someone create a post that shows who(user) should own
> what. I have always let postgres own the pgsql directory and I see
> that it is recomended that root own it.
Whenver I have installed postgres (as the postgres user), it has always
installed everything owned by postgres:postgres. I've never installed
postgres as root, except for the Perl interfaces (which must be installed
by root). This was the recommended procedure in earlier version of
PostgreSQL, but it seems in the newer documentation, it recommends
*against* installing as the postgres super-user.
-- Brett
http://www.chapelperilous.net/
------------------------------------------------------------------------
Toddlers are the stormtroopers of the Lord of Entropy.
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Permission Denied When i am Trying to take Backup
2001-10-10 12:24 ` Re: Permission Denied When i am Trying to take Backup Stefan Huber <looseleaf@gmx.net>
2001-10-11 20:03 ` Re: Permission Denied When i am Trying to take Backup Peter Eisentraut <peter_e@gmx.net>
2001-10-12 12:33 ` Re: Permission Denied When i am Trying to take Backup postgresql <pgsql@symcom.com>
@ 2001-10-13 03:12 ` Stuart Bishop <zen@shangri-la.dropbear.id.au>
1 sibling, 0 replies; 11+ messages in thread
From: Stuart Bishop @ 2001-10-13 03:12 UTC (permalink / raw)
To: pgsql-admin
On Friday, October 12, 2001, at 10:33 PM, postgresql wrote:
>
> Could someone create a post that shows who(user) should own
> what. I have always let postgres own the pgsql directory and I see
> that it is recomended that root own it.
>
The PostgreSQL processes should be run as an unprivilidged user
(generally
a user called 'postgres'). This user should have the minimal rights to
function, which in this case is write access to the data directory.
This is why the rest of PostgreSQL should be installed owned by another
user
(generally root). This ensures that if the postgres user account is
compromised, the rights it gains an attacker are minimal. All it can do
is
trash your database. If the PostgreSQL executables were writable by the
postgres user, an attacker could install a trojan (eg. a simple wrapper
around
pgsql) and compromise further accounts on the system, eventually getting
to root.
The truely paranoid mount whatever they can from a read-only file system
(eg. CDROM or a network file system).
The same methodology should apply to all background services that do not
require being run as root. Even software which does require root privs
generally drop their privs as soon as possible (eg. Apache).
--
Stuart Bishop <zen@shangri-la.dropbear.id.au>
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Permission Denied When i am Trying to take Backup
2001-10-10 12:24 ` Re: Permission Denied When i am Trying to take Backup Stefan Huber <looseleaf@gmx.net>
@ 2001-10-12 11:56 ` Stefan Huber <looseleaf@gmx.net>
2001-10-12 17:27 ` Re: Permission Denied When i am Trying to take Backup Tom Lane <tgl@sss.pgh.pa.us>
2001-10-12 20:29 ` Re: Permission Denied When i am Trying to take Backup Brett W. McCoy <bmccoy@chapelperilous.net>
1 sibling, 2 replies; 11+ messages in thread
From: Stefan Huber @ 2001-10-12 11:56 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-admin
Hi!
> > I always do a chown -R postgres:daemon /usr/local/pgsql (or
> > postgres:postgres) after installation.
>
>Which is a bad idea.
>
>The installation instructions were developed with some thought behind
>them.
Well, this might be true, if you are on a system, where more than one
humans are operating. Or are there some other reasons behind this philosophy?
I mean, a buffer overflow (I don't claim to know of any in Postgres) can
cause more problems when running as root than as user.
Can anyone explain these thoughts behind the instructions? Or pinpoint me
to the explanations in the docs.
Stefan
--
Murphy's Airport Axiom:
Your flight never leaves from gate #1.
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Permission Denied When i am Trying to take Backup
2001-10-10 12:24 ` Re: Permission Denied When i am Trying to take Backup Stefan Huber <looseleaf@gmx.net>
2001-10-12 11:56 ` Re: Permission Denied When i am Trying to take Backup Stefan Huber <looseleaf@gmx.net>
@ 2001-10-12 17:27 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 11+ messages in thread
From: Tom Lane @ 2001-10-12 17:27 UTC (permalink / raw)
To: Stefan Huber <looseleaf@gmx.net>; +Cc: Peter Eisentraut <peter_e@gmx.net>; pgsql-admin
Stefan Huber <looseleaf@gmx.net> writes:
> Well, this might be true, if you are on a system, where more than one
> humans are operating. Or are there some other reasons behind this philosophy?
The idea is that the executables shouldn't be writable by the postgres
user. That way, even if some db user manages to break into your
database superuser account, the amount of damage he can do is limited.
This has got nothing to do with whether your server system has other
people on it: as long as someone can connect as superuser, they can
cause the backend to scribble on any file that's writable by postgres.
$PGDATA and the files and directories under it need to be owned/writable
by the postgres user, but there's no reason for the rest of the
installation (bin, lib, share, etc) to be writable by the postgres user.
So doing "make install" as root and "initdb" as postgres sets you up
more securely than doing the install as postgres.
regards, tom lane
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Permission Denied When i am Trying to take Backup
2001-10-10 12:24 ` Re: Permission Denied When i am Trying to take Backup Stefan Huber <looseleaf@gmx.net>
2001-10-12 11:56 ` Re: Permission Denied When i am Trying to take Backup Stefan Huber <looseleaf@gmx.net>
@ 2001-10-12 20:29 ` Brett W. McCoy <bmccoy@chapelperilous.net>
1 sibling, 0 replies; 11+ messages in thread
From: Brett W. McCoy @ 2001-10-12 20:29 UTC (permalink / raw)
To: Stefan Huber <looseleaf@gmx.net>; +Cc: Peter Eisentraut <peter_e@gmx.net>; pgsql-admin
On Fri, 12 Oct 2001, Stefan Huber wrote:
> Well, this might be true, if you are on a system, where more than one
> humans are operating. Or are there some other reasons behind this philosophy?
> I mean, a buffer overflow (I don't claim to know of any in Postgres) can
> cause more problems when running as root than as user.
You should never run Postgres as root, regardless of whether or not root
owns the executables. The server should still always be run as a
non-priveleged user.
-- Brett
http://www.chapelperilous.net/
------------------------------------------------------------------------
La-dee-dee, la-dee-dah.
^ permalink raw reply [nested|flat] 11+ messages in thread
end of thread, other threads:[~2001-10-13 03:12 UTC | newest]
Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-10-10 12:00 ` Moovarkku Mudhalvan <mudhalvan@vasunas.com>
2001-10-10 12:14 ` Chris Ruprecht <chrup999@yahoo.com>
2001-10-10 12:55 ` Nick Fankhauser <nickf@ontko.com>
2001-10-10 12:24 ` Stefan Huber <looseleaf@gmx.net>
2001-10-11 20:03 ` Peter Eisentraut <peter_e@gmx.net>
2001-10-12 12:33 ` postgresql <pgsql@symcom.com>
2001-10-12 17:53 ` Brett W. McCoy <bmccoy@chapelperilous.net>
2001-10-13 03:12 ` Stuart Bishop <zen@shangri-la.dropbear.id.au>
2001-10-12 11:56 ` Stefan Huber <looseleaf@gmx.net>
2001-10-12 17:27 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-10-12 20:29 ` Brett W. McCoy <bmccoy@chapelperilous.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox