SSH VisualHostKey

SSH VisualHostKey

If you connect to a other system via ssh and you like to see the fingerprint visual, like:

Host key fingerprint is cf:2c:2e:f6:d4:d4:50:0f:bb:25:89:ec:84:c0:93:f2
+--[ RSA 2048]----+
|   ...   .o      |
|  . +. o.. +     |
|  +  .. +o+ o    |
|    E  o. .+     |
|       .S .      |
|        .o       |
|       .  o      |
|    o o  .       |
|   . +oo.        |
+-----------------+

Use this in the command line:

-o VisualHostKey=yes

or in the .ssh/config

VisualHostKey=yes 

Links:

http://www.dirk-loss.de/sshvis/drunken_bishop.pdf

LXC process list

LXC process list

If you want to see the processes of LXC container. There are two ways.

ps

[root@host ~]# ps -ef --forest
UID   PID   PPID  C STIME TTY    TIME     CMD
...
root  3171     1  0 09:57 ?      00:00:00 lxc-start -n ol6ctr1 -d
root  3182  3171  0 09:57 ?      00:00:00  \_ /sbin/init
root  3441  3182  0 09:57 ?      00:00:00      \_ /sbin/dhclient -H ol6ctr1 ...
root  3464  3182  0 09:57 ?      00:00:00      \_ /sbin/rsyslogd ...
root  3493  3182  0 09:57 ?      00:00:00      \_ /usr/sbin/sshd
root  3500  3182  0 09:57 pts/5  00:00:00      \_ /sbin/mingetty ... /dev/console
root  3504  3182  0 09:57 pts/1  00:00:00      \_ /sbin/mingetty ... /dev/tty1
root  3506  3182  0 09:57 pts/2  00:00:00      \_ /sbin/mingetty ... /dev/tty2
root  3508  3182  0 09:57 pts/3  00:00:00      \_ /sbin/mingetty ... /dev/tty3
root  3510  3182  0 09:57 pts/4  00:00:00      \_ /sbin/mingetty ... /dev/tty4

lxc-attach

[root@host ~]# lxc-attach -n ol6ctr1 -- /bin/ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1  19284  1516 ?        Ss   04:57   0:00 /sbin/init
root       202  0.0  0.0   9172   588 ?        Ss   04:57   0:00 /sbin/dhclient
root       225  0.0  0.1 245096  1332 ?        Ssl  04:57   0:00 /sbin/rsyslogd
root       252  0.0  0.1  66660  1192 ?        Ss   04:57   0:00 /usr/sbin/sshd
root       259  0.0  0.0   4116   568 lxc/console Ss+ 04:57   0:00 /sbin/mingett
root       263  0.0  0.0   4116   572 lxc/tty1 Ss+  04:57   0:00 /sbin/mingetty
root       265  0.0  0.0   4116   568 lxc/tty2 Ss+  04:57   0:00 /sbin/mingetty
root       267  0.0  0.0   4116   572 lxc/tty3 Ss+  04:57   0:00 /sbin/mingetty
root       269  0.0  0.0   4116   568 lxc/tty4 Ss+  04:57   0:00 /sbin/mingetty
root       283  0.0  0.1 110240  1144 ?        R+   04:59   0:00 /bin/ps aux

Links:

http://docs.oracle.com/cd/E37670_01/E37355/html/ol_shutdown_containers.html

PostgreSQL remote access

PostgreSQL remote access

Configure PostgreSQL to listen for remote connections:
Change this in /etc/postgresql/9.3/main/pg_hba.conf

listen_addresses = '*'

Configure PostgreSQL to accept remote connections (from any host):
Add this to /etc/postgresql/9.3/main/pg_hba.conf

host    all         all         0.0.0.0/0             md5

Configure PostgreSQL to accept remote connections (from 192.168.0.0/24 host):
Add this to /etc/postgresql/9.3/main/pg_hba.conf

host    all         all         192.168.0.0/24        md5

Restart PostgreSQL for the changes to take effect:

service postgresql restart

Links:
www.postgresql.org