---
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-on-debian/"
canonical_url: "https://h3manth.com/scribe/remotely-enable-remote-desktop-on-debian/"
markdown_url: "https://h3manth.com/scribe/blog/remotely-enable-remote-desktop-on-debian.md"
publishDate: "2012-03-09T00:00:00.000Z"
author: "Hemanth HM"
category: "javascript"
tags: ["programming"]
word_count: 169
reading_time_minutes: 1
x_markdown_tokens: 388
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 : **

```javascript
# Set appropriately, assuming 0 here
```

```javascript
display=0
# Need the machine-id
```

read -r machineid  /var/lib/dbus/machine-id

```javascript
# source the .dbus for the required variables
```

. "$HOME/.dbus/session-bus/$machineid-$display"

```javascript
# export the variables sourced above 

export DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID \\
```

DBUS_SESSION_BUS_WINDOWID

```javascript
# Enable remote access 
```

gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true

```javascript
# Disable prompt one connection.
```

gconftool-2 -s -t bool /desktop/gnome/remote_access/prompt_enabled false

```javascript
# 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! :)
