ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

SSH Config

SSH Config language and completions

Details

  • 7.0.1
    4.1.1
    1.1.3
  • github.​com
  • github.​com
  • 5 days ago
  • 2 hours ago
  • 13 years ago

Installs

  • Total 17K
  • Win 5K
  • Mac 8K
  • Linux 4K
Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23
Windows 0 0 1 0 2 0 1 0 1 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 3 2 1 0 1 1 0 1 0 2 1 1 0 0 1 1 0 0 1 0 2 0
Mac 1 0 0 2 3 1 3 0 1 0 1 1 0 1 0 0 1 1 0 0 0 0 0 0 0 0 3 5 0 1 2 3 0 1 0 1 0 2 1 5 2 1 0 0 3 3
Linux 0 2 0 0 1 2 1 0 0 0 0 1 0 1 0 1 0 0 2 1 0 2 0 1 2 0 2 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1

Readme

Source
raw.​githubusercontent.​com

SSH Config Language

Provides highlighting and snippets in Sublime Text for ~/.ssh/config, /etc/ssh/sshd_config, and some other SSH-related files.

The highlighting is not automatically activated on ~/.ssh/config because of a Sublime Text limitation. Use SSH Config: Open SSH Config File from the command palette or see the wiki for other options.

Sample screenshot

Installation

This package is available via Package Control. You can install it by searching for SSH in the Package Control: Install Package interface or by cloning this repository into your Sublime Text Packages directory.

Features

Commands

  • Edit package settings
  • Quick open files:
    • SSH Config
    • SSHD Config
    • Authorized Keys
    • Known Hosts

If the file-open commands open the wrong file for you, open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P), search for SSH Config: Settings, and put in content like this:

Error: language “jsonc” is not supported
{
    "file_locations": {
        "ssh_config": "~/.ssh/config",
        "sshd_config": "/etc/ssh/sshd_config",
        "known_hosts": "~/.ssh/known_hosts",
        "authorized_keys": "~/.ssh/authorized_keys",
    },
}

SSH Config files

  • Syntax highlighting
  • host snippet creates a new Host entry
  • match snippet creates a new Match entry
  • Snippets and Keyword completion for most parameters
  • Symbol Index for hosts and aliases (Ctrl+R or Cmd+R)
  • Automatic indentation

Note that ~/.ssh/config is not linked to the SSH Config syntax highlighting out of the box. This is because the filename is shared by other formats (notably .git/config) and we don't want to set the wrong highlighting for those. Several solutions are available on the wiki.

For file format information, consult man pages on the web (Linux, BSD, or Mac), or locally on your machine with

man 5 ssh_config

SSHD Config files

  • Syntax highlighting
  • match snippet creates a new Match entry
  • Snippets and Keyword completion for most parameters
  • Symbol Index for active and commented-out config options (Ctrl+R or Cmd+R)
  • Automatic indentation

For file format information, consult man pages on the web (Linux, BSD, or Mac), or locally on your machine with

man 5 sshd_config

Authorized Keys files

  • Syntax highlighting
  • Keyword completion for access restrictions
  • Symbol Index for annotations, which are typically the user@host (Ctrl+R or Cmd+R)

Public keys are also associated with this syntax, since the authorized_keys format is basically a strict superset of them.

For file format information, consult man pages on the web (Linux, BSD, or Mac), or locally on your machine with

PAGER='less -p ^"AUTHORIZED_KEYS"' man 8 sshd

Known Hosts files

  • Syntax highlighting
  • Symbol Index for hosts and IPs (Ctrl+R or Cmd+R)

For file format information, consult man pages on the web (Linux, BSD, or Mac), or locally on your machine with

PAGER='less -p ^"SSH_KNOWN_HOSTS"' man 8 sshd

Extras

  • PEM, PKCS1, PKCS8, and SSH keys have
    • Syntax highlighting
    • Symbol index for cert bundles
  • Completion and highlighting for crypto stuff
    • Key types (ssh -Q key)
    • KEX algorithms (ssh -Q kex)
    • Encryption ciphers (ssh -Q ciphers)
    • MACs (ssh -Q mac)

Building

  • Snippets, completions, and crypto names are built from the src directory in a simple Python script. Its only requirement is pyyaml.
  • Changes to any of the above should be modified in YAML and rebuilt.
  • Changes to syntaxes do not need rebuilding, but do need regression testing.

Syntax testing

  • Install this repository under Sublime Text Packages and name it SSH Config.
    • You can clone it there directly, move it there, or symlink it.
  • Open the project from under Packages/SSH Config.
  • Open a syntax test file located in the test directory.
  • Run the Build With: Syntax Tests command.
    • This is supplied by the Default Package, which is shipped with Sublime Text.
    • The command is available on the Command Palette when any test file is open.

The PackageDev package is helpful for writing tests but not required.