Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lL73K-0006mP-N6 for pgsql-general@arkaria.postgresql.org; Sat, 13 Mar 2021 16:23:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lL73J-0003O1-87 for pgsql-general@arkaria.postgresql.org; Sat, 13 Mar 2021 16:23:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lL73I-0003Ky-VO for pgsql-general@lists.postgresql.org; Sat, 13 Mar 2021 16:23:44 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lL73H-000401-1d for pgsql-general@postgresql.org; Sat, 13 Mar 2021 16:23:43 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id C14A219E1; Sat, 13 Mar 2021 11:23:41 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 13 Mar 2021 11:23:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=l k3B6d7tch9u7wtB5yjHmEz57vLl57DAAtYMRcuzyEY=; b=Fi1OzHLqexetVBfjK bB9yTKuuNrhcWjtuREx0wC1+i+u4lfR7m5/Uuu2e7JFq8yKs+gALT8a4Q1dC+Cdh xcdW5neGFMjqORXFNkSz+S2PuWwiIefxA87aVi3O+3cP9eAehCJkxSyL3OHnSls+ 8jHg1AHy5G3BsuaB+tI2NioDFQNwx9kWtLHyHM7kcckcR2SzDV8BaBAku6XLi1M/ PT9elxZTK1V26k52sAlqacTdG2v3v6wC8Of9RK1+Oc3cirTVi0ocUR5HVTUVJE47 txdkC49DDeGY3QfrfD7R3GjF98GHaVLKZim1PxUrZ7PnxINNtiAdtQ0RLrw1/7rR mUWGA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=lk3B6d7tch9u7wtB5yjHmEz57vLl57DAAtYMRcuzy EY=; b=QMtyXVnUfuHXeuxTAoDTf8IG9skDhQtT1/0OYjA7QOzdMaH3qNf6mNooK 5ymf4GHV2BRc/+gz+TqT3IR5G1VgsMiejFOyoZtlQbI/N5R0yDc9kdTFEKLQstn4 LWxovMZwBkYd3sEnEY2c/5ur+Qg0GKkxJwLKqroL6bL453cEqmikBQi9b2r+CDsI Ko0EHboDY9Nz1NC7It5Hmp+Zsq2/o2OdE3DlxYUeaw4f6lfv0kDysuC0sOYsAJxn +wTkdkN6CPblNQJjwU9gM9uOc+erAV4wYHBX4IURwNTSljnG6rtfInVLt3nZSY+r dOvzu42c2iMkE2xY3Zzmx38SCZ76w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddvgedgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeevveefveefueegffekkefhgeeiueffgfetueejvdfg hfeujeejhfekjeelgedtgeenucfkphepleejrdduudefrddvudejrddvjeenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from [192.168.1.4] (97-113-217-27.tukw.qwest.net [97.113.217.27]) by mail.messagingengine.com (Postfix) with ESMTPA id 91D3124005B; Sat, 13 Mar 2021 11:23:40 -0500 (EST) Subject: Re: how to set permission, so I can run pg_dumd in a cron job To: robert rottermann , "pgsql-general@postgresql.org" References: <08762210-ad92-7b0d-a1bc-45301bd76582@redcor.ch> From: Adrian Klaver Message-ID: Date: Sat, 13 Mar 2021 08:23:39 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <08762210-ad92-7b0d-a1bc-45301bd76582@redcor.ch> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/13/21 8:16 AM, robert rottermann wrote: > Hi Friends > > I would like to have a cronjob creating a dump of a db. > > I am on a ubuntu 18 lts, potgres v10. > > I have a user robert with superuser db permission. > > a database "mydb" of which I would like to to a nightly dump. > > > I tried to set thing in hba_conf like this: > > # Database administrative login by Unix domain socket > local   all             postgres peer > > # TYPE  DATABASE        USER            ADDRESS METHOD > > # "local" is for Unix domain socket connections only > local   all             all trust > # IPv4 local connections: > host    all             all             127.0.0.1/32 trust > > and I create a /root/.pgpass file with this content > > > hostname:port:database:username:password > localhost:5432:mydb:robert: > > > > but still I get: > > root@elfero:~# pg_dump  -U robert -d mydb > dumps/mydb.sql > pg_dump: [archiver (db)] connection to database "mydb" failed: FATAL: > Peer authentication failed for user "robert" > > > can you please give me a hand 1) Did you have the server reload the conf files after making the changes? 2) Is there an entry for something like: local all all peer before the lines you show above? > > thanks > > robert > > > -- Adrian Klaver adrian.klaver@aklaver.com