guix-home-manager/doc/ssh.md

ssh.md

OpenSSH

OpenSSH is an SSH client and server software. It allows you to connect to remote machines securely.

Main Configuration

The main configuration is not complete compared to the configuration possibilities of the client. It however implements a big part of the possibilities.

Scheme Variable: ssh-home-type

The type of service that generates configuration files for OpenSSH. Its value is an ssh-configuration object.

Data Type: ssh-configuration

Data type that represents the OpenSSH configuration. This data type has the following fields:

Example

(user-home
  ssh-home-type
  (ssh-configuration
    (authorized-keys '("ssh-rsa ... alice@computilo"))
    (known-hosts
      (list
        (ssh-known-host-configuration
         (names '("git.savannah.gnu.org" "git.sv.gnu.org" "208.118.235.201"
                  "209.51.188.201"))
         (key (string-append
                "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBP9c1Z2f4O"
                "HxymvLxqxQ/hY1g0ol0/iiXUrVFGZBBq4h5gD05c7Gw9rRrcrvF9XvumBvOghO"
                "QzDSZZLRWvFGocA=")))))
    (default-host
      (ssh-host-configuration
        (identity-file "/data/alice/.ssh/id_rsa")))))

Known Hosts Configuration

Each known host can be configured with the following data type:

Data Type: ssh-known-host-configuration

This data type represents a known host. It contains the following fields:

Host Configuration

Each host to which you may desire to connect to can be configured with the following data type:

Data Type: ssh-host-configuration

This data type represents a host. It contains the following fields:

If you connect to a configured host with its name, you can still override values on the command line in the usual way. For instance, if you want to connect to foo, but on a different port, you can run ssh foo -p 2222. Additionally, this data type is used for default configuration. The default host will set default values for every other hosts, and if not set anywhere, global defaults apply.