HomeDocumentationAPI Reference
Log In
These docs are for v16. Click to read the latest docs for v33.

SSH Connections with Native Clients

This section describes how to establish SSH connections with native clients.

Users can connect to target hosts/accounts using the SSH clients installed on their workstations, without needing to use the PrivX GUI. Connections are authenticated against PrivX. For example, if PrivX allows you to access a target account with certificate authentication, your native clients will also connect using certificate authentication without prompting you for target-account credentials.

Prerequisites

  • Specify which roles may be used for SSH-native-client connections.

  • Your PrivX license must allow using native client connections.

  • After ugrading PrivX, you may need to re-download the extender-config.toml file for the native client connections to work with via Extenders. For more instructions about extender configuration file, see Setting up PrivX Components.

  • For agent-based connections only:

    • The ​Use with PrivX agent​ option is enabled in the relevant users' roles, at ​Settings→Roles​​.

    • PrivX agent must be set up on the user's workstation. For instructions setting up PrivX agents, see PrivX-Agent Setup.

Connecting via PrivX Bastion

Using native SSH clients, you can connect to targets via PrivX SSH Bastion. By default PrivX SSH Bastion runs on port 2222. PrivX SSH Bastion provides the following connection modes:

  • ​​Interactive​​: Access PrivX Bastion to list and select possible targets.

  • ​​Direct​​: Specify your connection target directly to the native client.

📘

Note

PrivX-Bastion connections are verified against the PrivX-Bastion host key. You may verify and install these host keys from the ​Connections→Native Clients​​ page.

​​Connecting Interactively​​

To connect via PrivX Bastion interactively:

  1. Connect to PrivX SSH Bastion using your PrivX account. For example, with ​ssh​​, ​sftp​​, or ​scp​​:

    $ ssh -p 2222 ​privxuser​​@​privx.example.com​​
    
    $ sftp -P 2222 ​privxuser​​@​privx.example.com​​
    
    $ scp -P 2222 ​local/path privxuser​​@​privx.example.com​​:​remote/path​​
    
    $ scp -P 2222 ​privxuser​​@​privx.example.com​​:​remote/path ​​​local/path​​
    

    Replace the example values as follows:

    • ​​privxuser​​ - Your PrivX-user name.

    • ​​privx.example.com​​ - Your PrivX-server address.

    • ​​local/path​​ - Local file/directory path for scp.

    • ​​remote/path​​ - Remote file/directory path for scp.

    Provide your PrivX-user password when prompted.

  2. You will be presented with a list of possible targets. Select a target to connect to it.

​​Connecting Directly​​

To directly connect via PrivX Bastion, provide:

  • Target-user name

  • Target-host address

  • PrivX-user name

  • PrivX-server address

  • ​​(Optional)​​ Extender name

  • ​​(Optional)​​ Target port

Full bastion syntax is as follows:

targetuser%extender%targethost%targetport%[email protected]

Common case leaves out the extender and the target port, leaving the syntax as following:

targetuser%targethost%[email protected]

Following are examples of ssh, scp and sftp usage with the connection string:

$ ssh -p 2222 targetuser%targethost%[email protected]
$ scp -P 2222 targetuser%targethost%[email protected]:example.txt \
/target/directory
$ sftp -P 2222 targetuser%targethost%[email protected]

Following is an example using PrivX Extender:

$ ssh -P 2222 targetuser%extender%targethost%[email protected]
$ scp -P 2222 example.txt \
targetuser%extender%targethost%[email protected]:/tmp

If you use native-client connections with bastion syntax often, consider specifying the connection parameters in the users' client configuration (typically at ​/etc/ssh/ssh_config​ or ​~/.ssh/config​​) using ​Host​​ blocks. For example:

Host targethost.example.com
    Port 2222
    User targetuser%targethost%privx-user
    Hostname privx.example.com

After which you can connect with much simpler syntax:

$ ssh targethost.example.com

User sessions with native SSH clients can be monitored. For more information about viewing session audit data, see Viewing Audit Data​​. For more information about setting up session recording for a host, see Session-Recording Setup.

SSH-Bastion connections prompt you to log in to PrivX. For automated, scripted access, set up public-key authentication as described in Public-Key Authentication (SSH Bastion).

Connecting via PrivX Agent

Linux and MacOS

After PrivX agent is set up for your workstation account, you can establish connections to targets using native clients with the agent. To do this on Linux or MacOS:

  1. Log into the workstation as the user for whom native clients have been set up.

    You may verify that the agent is running with:

    $ privx-agent-ctl status
    

    The command should return a message similar to the following:

    PrivX SSH Agent Status
      PrivX Server          https://privx.example.com
      Login status          logged out
    

    If necessary, you can manually start the PrivX agent with:

    $ ./privx-agent-unix bash
    
  2. Via the terminal, authenticate against PrivX using your PrivX credentials. For example (replace ​username​​ with your PrivX user name):

    $ privx-agent-ctl login ​username​​
    

    You may verify your login status with:

    $ privx-agent-ctl status
    

    After entering your PrivX credentials correctly, your native SSH clients (such as ​ssh​​) will authenticate connections via PrivX. For a list of valid connection targets, run:

    $ privx-agent-ctl target list
    
    Accessible targets and granting roles:
    
      bilberry
          [email protected]:222           Example Role 01
      ...
    

    You could then connect to one of the listed targets. In this example, by running:

    $ ssh [email protected] -p 222
    

Windows

After PrivX agent is set up for your workstation account, you can establish connections to targets using native clients with the agent. To do this on Windows:

  1. Use the PrivX agent to authenticate with PrivX. To do this, right click the PrivX-agent tray icon, then click ​Login​​. Log in using your PrivX credentials. Complete multi-factor authentication if required.

    📘

    Note

    If PrivX-agent login fails with ​Failed: Login through web UI is required​​, then please use a web browser to log into PrivX GUI and complete MFA setup as described in Multi-Factor Authentication.

  2. To connect to a target host, right click PrivX agent tray icon, and click ​Connections​​.

    Provide the following connection settings:

    • ​​Role (optional)​​: You may choose to log in with the permissions of a specifc PrivX role. By default, you are logged in using any applicable role.

    • ​​Target​​: The target host.

    • ​​Client​​: The native client used for connecting; PuTTY for connecting through SSH or PSFTP through SFTP.

    After providing the connection settings, click ​Connect​​. Alternatively, you can directly use your SSH client for connecting.