How to remove Gnome from Ubuntu Desktop 14.04
Solution 1:
If it is already installed, you can remove the Ubuntu Desktop metapackage and install the server softwares you need:
sudo apt-get install openssh
Configure SSH according to your needs. Then:
sudo apt-get remove ubuntu-desktop
sudo apt-get autoremove
Solution 2:
sudo apt-get purge unity gnome-shell lightdm
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get -f install