---
title: Deactivate xscreensaver via SSH
kind: blog
description: 'While configuring my HTPC via SSH, I needed to deactivate its screensaver without having access to its own keyboard or mouse. Here''s how to do that from the (SSH) command line:'
words: 23
readingMinutes: 1
created: '2013-12-23T17:58:23.000Z'
updated: '2026-06-27T21:03:45+02:00'
tags:
  - linux
  - screensaver
  - ssh
  - htpc
  - system-administration
---
```shell
xscreensaver-command -deactivate
```

If you happen to use gnome-screensaver (default in Ubuntu), the following command might help (not tested):

```shell
DISPLAY=:0 gnome-screensaver-command -p
```

Thanks to YaronSh on the [Ubuntu forums](https://ubuntuforums.org/showthread.php?t=632580).
