There are several way to activate function programe in Ubuntu thru terminal that we are hard to find in the help menu. But with a little search we can find them in ubuntu help.
What make me curious was how to activate or disactivate the remote desktop function in ubuntu through terminal console. Especially when we want to activate the client’s remote desktop. Of course the client doesn’t have to know about it.
First we need to make sure port 22 is open. We can not change anything in client’s computer if we are not inside it. Let’s say it is open. So connect to it, and do these command :
gconftool-2 -s -t bool /desktop/gnome/remote_access/prompt_enabled false ## to disable the remote desktop
gconftool-2 –type bool –set /desktop/gnome/remote_access/use_alternative_port true ## to set another port, the default is 5900
gconftool-2 –type int –set /desktop/gnome/remote_access/alternative_port 5909 ##define the alternative port
For vnc use these command
gconftool-2 –type string –set /desktop/gnome/remote_access/vnc_password mypassword
The exact location of gconf file setting is here:
But sometime in my other computer, those above command is not working. So we need something else. Like running the vino-server command. Vino-server is the remote desktop command, but it seems different when we access it from inside ubuntu desktop.
First Set the client’ setting. The weakness is we have to access the client’s computer personally without him. How can I do that? Well cause the computer’s lab are in my hand so it’s easy for me.
It will come up with some dialogue. Fill in the boxes depend on what you want.
and press close. The setting in vino will remain that way. That’s it.
Now when we want to activate the remote desktop, connect to ssh chanel that I already set it up first in the client.
And run this
Then go back to your terminal and check which port that open. Usually 5900 or 5901. Finally use your vncviewer to access it.
To make it automatically run in client computer during booting add the script to /etc/rc.local in client computer.
/usr/lib/vino/vino-server –display=:0.0 &
source : ubuntu help