Remotely enable remote desktop on Debian
It so happened, as I was working from home last Friday, box there at office had only ssh enabled, but was in need of remote desktop badly [ But default it's not enabled ].
Below is the simple script that one needs to run on the box, after ssh to enable remote desktop connection remotely i.e via SSH :
# Set appropriately, assuming 0 here
display=0
# Need the machine-id
read -r machineid < /var/lib/dbus/machine-id
# source the .dbus for the required variables
. "$HOME/.dbus/session-bus/$machineid-$display"
# export the variables sourced above
export DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID \
DBUS_SESSION_BUS_WINDOWID
# Enable remote access
gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true
# Disable prompt one connection.
gconftool-2 -s -t bool /desktop/gnome/remote_access/prompt_enabled false
# Disable view only.
gconftool-2 -s -t bool /desktop/gnome/remote_access/view_only false
display=0
# Need the machine-id
read -r machineid < /var/lib/dbus/machine-id
# source the .dbus for the required variables
. "$HOME/.dbus/session-bus/$machineid-$display"
# export the variables sourced above
export DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID \
DBUS_SESSION_BUS_WINDOWID
# Enable remote access
gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true
# Disable prompt one connection.
gconftool-2 -s -t bool /desktop/gnome/remote_access/prompt_enabled false
# Disable view only.
gconftool-2 -s -t bool /desktop/gnome/remote_access/view_only false
After which any vnc client would help us to connect to the box and later the permission can be changed as per the need. Happy hacking! :)
Recent blog posts
- watir-webdriver web inspector
- gem list to gemfile
- Packing ruby2.0 on debian.
- Made it into The Guinness Book!
- to_h in ruby 2.0
- Filter elements by pattern jQuery.
- Better HTML password fields for mobile ?
- Grayscale image when user offline
- nth-child CSS pseudo-class Christmas colors
- EventEmitter in nodejs