I'm using my backup computer as a server. It's running Debian and I want to kill everything gnome related to save memory. I'm accessing remotely through ssh.
Your Gnome Desktop Manager Session is running in the Xserver. Both are just normal services (daemons) your system is starting at boot.
It seems, that X is a child-Process of the Desktop Manager in Debian/Ubuntu. So you have to stop that one (On Debian this might be gdm, on Ubuntu ligthdm)
You can stop gdm for this session by using its init-script, with
Or you can remove it from the list of daemons started:
If you are not sure which desktop manager is in use, you can either look for the scripts in /etc/init.d/ or you can type
to search for all running processes containing "dm" (this might yield much more than just your dm though).