At a guess, you've tried to edit the file in a directory that doesn't actually exist, because the path on your system is different. It'd help if you showed the exact command you ran, the exact error message text, your version of PostgreSQL and how you installed Pg (Homebrew, EnterpriseDB packages, etc).
To edit pg_hba.conf - PostgreSQL Client Authentication Configuration File:
In psql, run:
To edit pg_hba.conf - PostgreSQL Client Authentication Configuration File:
In psql, run:
SHOW hba_file;and see what location it reports. That's the file you must edit. If you can't get into psql you must locate it in the file system; try:
cdWhen you've found the correct path, you don't need to use su to edit it from a postgres login; just use:
sudo find / -name pg_hba.conf
sudo vim /path/to/pg_hba.confeg on my system:
sudo vim /usr/local/pgsql/data/pg_hba.confIf you prefer to use a different editor, anything that can run from the command line should work, including most GUI editors.