---
title: "Remotely Enable Remote Desktop on Debian"
description: "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."
url: "https://h3manth.com/scribe/remotely-enable-remote-desktop-debian/"
canonical_url: "https://h3manth.com/scribe/remotely-enable-remote-desktop-debian/"
markdown_url: "https://h3manth.com/scribe/blog/remotely-enable-remote-desktop-debian.md"
publishDate: "2012-03-10T00:00:00.000Z"
author: "Hemanth HM"
category: "linux"
tags: ["ubuntu","linux"]
word_count: 154
reading_time_minutes: 1
x_markdown_tokens: 366
content_signal: "ai-train=yes, search=yes, ai-input=yes"
---

# 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.

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

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! :)
