###前提・実現したいこと
postgresqlを利用できるようにしたいです。
postgresユーザーにスイッチして psql コマンドを実施するとIdent認証に失敗します。
pg_hba.conf を見ても特に問題はないと思うのですが、なぜIdent認証に失敗するのでしょうか。
また、 /root ディレクトリを変更しようとして失敗しているメッセージも出ていますが、 /root 配下に参照するようなファイルはないはずなのに、と疑問を抱えています。この点は postgres ユーザにスイッチする時に - をつければ回避できますが、何か関係しているのでしょうか。
###発生している問題・エラーメッセージ
[root@RHEL7 ~]# su postgres bash-4.2$ psql could not change directory to "/root": 許可がありません psql: FATAL: ユーザ"postgres"のIdent認証に失敗しました
###試したこと
/var/lib/pgsql/9.4/data/pg_hba.conf でIPv4のMETHOD欄が ident になっていることを確認しました(デフォルトのままです)。
# TYPE DATABASE USER ADDRESS METHOD # "local" is for Unix domain socket connections only local all all peer # IPv4 local connections: host all all 127.0.0.1/32 ident # IPv6 local connections: host all all ::1/128 ident # Allow replication connections from localhost, by a user with the # replication privilege. #local replication postgres peer #host replication postgres 127.0.0.1/32 ident #host replication postgres ::1/128 ident
###補足情報(言語/FW/ツール等のバージョンなど)
OSはRHEL7.2、postgresは9.4.11です。
OSインストール時のサービスでpostgres9.2の導入があり、入れていました。
その後postgres9.2を yum remove postgresql で削除し、postgres9.4.11をインストールしました。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/05/22 00:18 編集
2017/05/22 12:15
2017/05/23 00:28