---
name: "ssh-diff"
section: "1"
platform: "linux"
package: "ssh-tools"
version: "1.9-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ssh-diff"
---

# ssh-diff(1)

## NAME

ssh-diff

## SYNOPSIS

ssh-diff \[OPTIONS\] FILE \[user@\]hostname\[:FILE\]

## DESCRIPTION

diff a file over SSH

There is an extra roundtrip to the remote system\
 to check for the existence of the file to be diffed.\
 So if you are not using SSH Keys\
 you may get prompted twice for a password.

Use "CHECK\_REMOTE\_FILE\_EXISTS=NO ssh-diff" to disable that behavior

## DIFF\_OPTIONS

All options your local diff command supports ( except '-r' ).\
 See 'man diff' and 'diff **--help**' for more information.

## SSH\_OPTIONS

- **-4**

  Use IPv4 only

- **-6**

  Use IPv6 only

- **-p** port

  Port to connect to on the remote host.\
   This can be specified on a per-host basis in the configuration file.

## ENVIRONMENT

CHECK\_REMOTE\_FILE\_EXISTS    NO\|YES    remote file checking

## EXAMPLES

- \# Default

  - ssh-diff */etc/hosts* 192.168.1.10

  - ssh-diff */etc/hosts* root@192.168.1.10

  - ssh-diff */etc/hosts* root@192.168.1.10:/etc/hosts.old

  - \# Side-by-Side

  - ssh-diff **-y** */etc/hosts* 192.168.1.10

  - ssh-diff **-y** */etc/hosts* root@192.168.1.10

  - ssh-diff **-y** */etc/hosts* root@192.168.1.10:/etc/hosts.old

  - \# Unified

  - ssh-diff **-u** */etc/hosts* 192.168.1.10

  - ssh-diff **-u** */etc/hosts* root@192.168.1.10

  - ssh-diff **-u** */etc/hosts* root@192.168.1.10:/etc/hosts.old
