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.
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.
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.
Direct using ProxyCommand: Specify your PrivX username via ssh_config.
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.
To connect via PrivX Bastion interactively:
Connect to PrivX SSH Bastion using your PrivX account. For example, with
$ ssh -p 2222 firstname.lastname@example.org
$ sftp -P 2222 email@example.com
$ scp -P 2222 local/path firstname.lastname@example.org:remote/path
$ scp -P 2222 email@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.
You will be presented with a list of possible targets. Select a target to connect to it.
To directly connect via PrivX Bastion, provide:
(Optional) Extender name
(Optional) Target port
By default bastion runs on your PrivX servers, port 2222.
Full bastion syntax is as follows:
Common case leaves out the extender and the target port, leaving the syntax as following:
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
~/.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 directly via PrivX Bastion using ProxyCommand allows you to apply most configurations in the client-users' SSH configuration. This method requires you to use public-key authentication to PrivX Bastion. The SSH-client user must have an SSH keypair.
To connect directly using ProxyCommand:
Add PrivX-Bastion host keys to the SSH-client's known-hosts file. You can get the Bastion host keys from the Connections→Native Clients page.
Add the client-user's authorized key to their PrivX account, as described in Public-Key Authentication (SSH Bastion).
Configure SSH client to use public-key authentication and a proxy when connecting to target hosts. These configuration options can be specified in the client-user's client configuration (typically at
~/.ssh/config), for example:
Host * IdentityFile ~/.ssh/privx-bastion HostKeyAlias [privx.example.com]:2222 ProxyCommand nc -X connect -x privx.example.com:1080 %h %p
In the example, replace
privx.example.comwith your PrivX address.
Note that the parameters your
nccommand accepts may be different from the example. You can substitute
ncwith another proxy command that supports http connect or SOCKS5/4a proxy protocol.
By default PrivX Bastion listens for proxy connections on port 1080.
Connect to target. If you provided the configuration options in the client-user's client configuration:
Alternatively you may provide the configuration options in the
sshcommand, for example:
ssh -o "IdentityFile ~/.ssh/privx-bastion" \ -o "HostKeyAlias [privx.example.com]:2222" \ -o "ProxyCommand nc -X connect -x privx.example.com:1080 %h %p" \ [email protected]
Your connection will be routed via PrivX Bastion to the final target. Connection to PrivX Bastion is authenticated using public-key authentication.
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:
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
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
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:
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.
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.
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.
Updated 26 days ago