I want to install an Nvidia toolkit on a remote server. It seems I should stop X server using sudo service lightdm stop
. I don't know enough about this command, I'm afraid that I lose the connection to the remote server and then I can't start it again or anything else. Is it safe to run this command on an ssh client?
It's "safe" to run this command from ssh, meaning that it is very unlikely to break your ssh connection.
This is (apparently, by experiment) true even if you are using "ssh -X" and running a graphical application on another X server -- that graphical application shouldn't be affected.
However, you have to decide for yourself if there's anything running inside your X11 server that shouldn't be killed.
Consider running a terminal session manager such as byobu or screen for remote administration. Then if your ssh connection is interrupted you can reattach to the same shell later and carry on where you left off.