# Zero-Trust SSH Access

- Link: https://www.agilicus.com/anyx-guide/zero-trust-ssh-access/
- Published: 2024-05-14T00:24:45+00:00
- Author: Don Bowman

1. [Home](https://www.agilicus.com/)
 2. Zero-Trust SSH Access

![7423582c-ssh-terminal](https://www.agilicus.com/www/7423582c-ssh-terminal.svg)

Zero Trust. Infinite Convenience.

---

## **SSH Access**

Any identity provider.

Multi-factor authentication.

Direct SSH access, end-to-end encrypted.

Web access from any device, or, existing SSH client.

[CONTACT](https://www.agilicus.com/contact-us/)

## SSH Access via Zero Trust

![Securely access servers without public IPs using Agilicus. This diagram illustrates
a simple SSH access setup leveraging a secure tunnel for remote server management,
enhancing network security by eliminating the need for direct IP exposure.](https://
www.agilicus.com/www/92c6d021-simple-ssh-access.svg)

SSH by its very nature is end-to-end encryption with strong protection against Man-
In-The-Middle attacks. All servers need to be accessible via SSH to be manageable,
often by external users (e.g. vendors, outsourced NOC, etc). However, despite SSH
being strong on encryption it is challenging on accessiblity. The servers are typically
on private networks (e.g. Virtual-Private-Cloud VPC, internal network VLAN’s, etc).
Making them directly accessible to the Internet can be dangerous (we would have 
to somehow police that all users have passphrases on their keys, that we don’t have
passwords allowed, etc.). SSH jump-boxes add a step to the workflow, are difficult
to ssh-port-forward and scp through. VPN access is difficult to secure on a per-
server basis, often being all-or-none.

In this guide we will setup the Agilicus Zero-Trust Network Access to directly access
arbitrary SSH servers. The users will see them as being directly Internet connected.
The users will have zero configuration (after the initial setup). Users can be individually
authorised on a per SSH server basis. Additionally, users can be federated for identity
by any upstream identity provider, allowing an external vendor to be identified 
by their own corporate Azure Active Directory, an independent contractor via their
Google login.

The data flow is such that the SSH TCP session is intact from the client to the 
server: the hostkeys are unaltered, SSH anti-tamper mechanisms are unperturbed. 
SFTP just works.

[⌊SSH Animated Data Flow⌉⌊SSH Animated Data Flow⌉[

The end user can use any SSH client (ssh command line, [mobaxterm](https://mobaxterm.mobatek.net/),
[putty](https://www.putty.org/), etc), with no complicated config to remember. The
system administrator can gate access on/off per user, and, see an audit trail of
who has accessed what, when, from where.

## SSH Access Setup

Note: you can use a site-to-site VPN via IPSEC, or use the onsite Agilicus Connector
for each pool of servers. These instructions assume the latter.

### 1. CREATE ORGANISATION

Your Organisation lets you setup your identity providers, your DNS name (CNAME),
and control your users.
See [SIGNUP](https://www.agilicus.com/anyx-guide/signup/)

### 2. SETUP IDENTITY

You can enable Google, Apple, LinkedIn as check box items. You may also wish to 
enable [Azure Active Directory](https://www.agilicus.com/anyx-guide/azure-active-directory/)

Also setup initial users and group membership.

### 3. CREATE CONNECTOR PER SITE

Each pool of servers needs a method to reach it. This can be a site-to-site VPN,
or an on-site connector. [Install](https://www.agilicus.com/anyx-guide/agilicus-connector/)
a connector now, this may be on each SSH server, on 1 of the servers that can reach
the others, on a machine in the same network, its up to you.

### 4. CREATE SSH RESOURCE

The SSH resource has a unique name, a upstream host-name, and upstream port. Configuration
will be automatically created for desktop clients such as OpenSSH or Putty.

### 5. ASSIGN PERMISSIONS

We must now assign ‘Owner’ permission to each user or group that should be able 
to connect. See “[Resource Permissions](https://www.agilicus.com/anyx-guide/permissions/)”
for more information.

## SSH Resource Setup

4 steps:

 1. Select the connector (the site on which the underlying SSH resource exists)
 2. Create a name for the SSH resource. This will appear as a valid hostname and must
    be unique within your sub-domain. Feel free to use a pattern, e.g. ‘site-host-ssh’.
 3. Select the hostname/IP and port that the SSH server is on in that remote network.
 4. Assign permissions (who can use this SSH resource)

[⌊aa436223-image⌉⌊aa436223-image⌉[

[⌊1920e382-image⌉⌊1920e382-image⌉[

[⌊20441f67-image⌉⌊20441f67-image⌉[

[⌊ab42d7ba-image⌉⌊ab42d7ba-image⌉[

The underlying SSH resources will also show up under Network Resources.

### Automatic Sign-In (cached credentials)

In some cases you wish end-users to be able to sign in via the web interface, but
do not wish to share the credentials with them. For this purpose Agilicus has a 
secure credential store and key or password stuffing. You may configure this during
the creation of a new SSH resource, or, later on the existing resource as below.

Note: the SSH key cannot be retrieved from the system. Once you have configured 
it, it is one-way encrypted, if you wish to change it later you may, but you must
keep your own copy.

[⌊e8c31ed8-image⌉⌊e8c31ed8-image⌉[

## Using the SSH Resource

![0bcebb0a-image](https://www.agilicus.com/www/0bcebb0a-image.png)

If you have not done so, install the Agilicus Launcher on your desktop (Windows,
Linux Mac) from profile (https://profile.__MYDOMAIN__). The Launcher support runs
on demand, it is not a service. It will automatically configure OpenSSH (Windows,
MAC, Linux), or Putty (Windows).

Note: on Windows, the Launcher also creates a saved [WinSCP](https://winscp.net/)
site for each SSH resource, so users can transfer files over SFTP alongside their
terminal client.

Note: The Launcher will configure OpenSSH if the file ~/.ssh/config exists. If you
have not used SSH before, you might need to create this file.

At this stage, you can ssh directly to the server, using the name you gave above.
For example, if in step 4 you called the SSH resource “foobar”, you can type ‘ssh
foobar’. This might bring up a browser to identify you and/or perform multi-factor
authentication. The data flow is as shown below.

[⌊Zero-Trust SSH Data Flow⌉⌊Zero-Trust SSH Data Flow⌉[
