Skip to content

Instantly share code, notes, and snippets.

@ojacobson
Created March 22, 2013 22:19
Show Gist options
  • Save ojacobson/5225221 to your computer and use it in GitHub Desktop.
Save ojacobson/5225221 to your computer and use it in GitHub Desktop.
root@alpha:/etc/postgresql/9.2/main# sudo -u postgres createuser --no-createdb --no-createrole --no-superuser --pwprompt example
Enter password for new role:
Enter it again:
root@beta:~# psql --host alpha --user example postgres
psql: FATAL: no pg_hba.conf entry for host "192.168.50.2", user "example", database "postgres", SSL off
root@alpha:/etc/postgresql/9.2/main# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:a8:e5:5f
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fea8:e55f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5742 errors:0 dropped:0 overruns:0 frame:0
TX packets:2647 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3384971 (3.3 MB) TX bytes:280942 (280.9 KB)
eth1 Link encap:Ethernet HWaddr 08:00:27:48:05:7b
inet addr:192.168.50.1 Bcast:192.168.50.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe48:57b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:60 (60.0 B) TX bytes:510 (510.0 B)
ifroot@beta:~# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:a8:e5:5f
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fea8:e55f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5001 errors:0 dropped:0 overruns:0 frame:0
TX packets:1994 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3233619 (3.2 MB) TX bytes:173067 (173.0 KB)
eth1 Link encap:Ethernet HWaddr 08:00:27:94:0e:c6
inet addr:192.168.50.2 Bcast:192.168.50.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe94:ec6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:44 errors:0 dropped:0 overruns:0 frame:0
TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3683 (3.6 KB) TX bytes:3200 (3.2 KB)
root@alpha:/etc/postgresql/9.2/main# egrep -v '^#' pg_hba.conf
host all all 192.168.50.0 255.255.255.0 md5
host replication all 192.168.50.0 255.255.255.0 md5
local all postgres peer
local all all peer
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment