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 1kAgfb-0007dv-82 for pgsql-bugs@arkaria.postgresql.org; Tue, 25 Aug 2020 21:39:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kAgfa-00057n-4w for pgsql-bugs@arkaria.postgresql.org; Tue, 25 Aug 2020 21:39:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAgfZ-00057f-Um for pgsql-bugs@lists.postgresql.org; Tue, 25 Aug 2020 21:39:53 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kAgfW-0008Uo-So for pgsql-bugs@lists.postgresql.org; Tue, 25 Aug 2020 21:39:53 +0000 Received: by mail-qk1-x744.google.com with SMTP id g26so306890qka.3 for ; Tue, 25 Aug 2020 14:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=BCjPC3c6G/oKa1dR3r6ZXm4g1RVBoiHCGpvOHB3QWFg=; b=FMFb/3VWPjuUxiggSSmbxmNgCWh+xvDGj0n/dTrpUFmoIcsWPyCN8WD9OAHI5oFpkd rdqR7Ft2oKQd4lybtL+2YpbtyTm+MLS7wjBJHXHtx0rlDPSTaPyI+e3P+/3z4y5mrYgZ BsJbQIvZKx+wEpshU93OYMvgNDExZKzkSYmQUgwUEyl9v/tR7mOAJ36jY/Z4ZDHQTEpj oeOjhkO7RMJQhbgVBXDcSld4i6ZaPUw6173KFmnPUEp1Bch2kR2rfj8PDwEFABX4Zgi6 BbNdUAUFUt/xZDC7+TzeOmE8lrMAMbOOR8dcCusb65LBEbhX1/pMDV0ey0v4x+9byH7F Evug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=BCjPC3c6G/oKa1dR3r6ZXm4g1RVBoiHCGpvOHB3QWFg=; b=FP2BNzZwlceiAgSGKkiXy06qiUBZZRshjpS27Of70w2NHlT4mKSA3HnzUBpvDCGtwt Kr7FUDwW1nD8CNe69dhO/dHLTCrXU42OWCO2hAtPZ9FUUgRCtPW+2k/1MZ7Q2MJswy2v XZheh8YT3Pj7UrmTB0TKcrcPHT+nwCK+cqFqDw/wEQUKg8rlpvGzic8BMqxDM2LFMs2d glSw99xsv6qzEXegg9zi7V3WvEEFOObPlWNCYJ4EOTxY9eTr/dwEgeIbhvs8C+u3jEYi l5CNEDVsOaED7Kc4KBjIEMBRJBbKXuZ/INyjiUJckpsnrhZxJlB3suMRt66OM3gOAPJ9 GizA== X-Gm-Message-State: AOAM530KX7XGdpNdYkA/b3O7/eFGLAzFQiBOKyBMcOVuDpuf3VL3zoem Z/sxt5A0QpANgXKFiCPLns7KmGlmid/55+RhAoIpSlauAOKKQGzo9pBaIHN8X7Sl5nHpOOokfqf 29wJT0zPNk2z+yyp4eOahl667zdtYLjyHe0JPeyR1qXPgim/bG1EiC9MaiTTmvrRGz0HEqtAyv6 haXNUu/FF6hsdf X-Google-Smtp-Source: ABdhPJwTBr7UlXzO7vFMcUgTqDbRRbvzxbQn904Yz1Z7PbjmoK7OF7nidwTqIj6CNruJcCD3LXcxIA== X-Received: by 2002:a05:620a:4051:: with SMTP id i17mr8728014qko.457.1598391589118; Tue, 25 Aug 2020 14:39:49 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.19.47]) by smtp.gmail.com with ESMTPSA id 20sm302059qtp.53.2020.08.25.14.39.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 14:39:48 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id AEAAF2A1B5D; Tue, 25 Aug 2020 17:39:46 -0400 (-04) Date: Tue, 25 Aug 2020 17:39:46 -0400 From: Alvaro Herrera To: "hans.wolters" Cc: "pgsql-bugs@lists.postgresql.org" Subject: Re: password saved in .psql_history Message-ID: <20200825213946.GA22117@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Aug-25, hans.wolters wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > Dear all, > I noticed the password of a used is stored in the history of the psql user (postgres in my case). This happens when alter user with password '' is used. > I suppose it is not a real bug but it might be handy to filter that for things like a history listing. This is why you should use \password in psql instead of 'alter user .. password'. (Well, that and the server log and risk of unencrypted password traffic.) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services