SFTP with JetBrains IDE
JetBrain's IDEs, like PyCharm, GoLand, and IntelliJ, allow browsing, copying, and editing files on a remote server using the SFTP protocol. You can integrate Teleport Server Access with your IDE, so you can copy files to and from a remote machine without using a third-party client.
This guide explains how to use Teleport and a JetBrains IDE to access files with SFTP.
- JetBrains IDE like PyCharm, IntelliJ, GoLand etc. See Products for a full list of JetBrains IDEs.
- One or more Teleport Nodes with Server Access enabled. If you have not yet done this, read the Server Access Getting Started Guide to learn how.
Configure your local SSH client to access Teleport Nodes, assigning the
--proxy flag to the address of your Teleport Proxy Service (e.g.,
mytenant.teleport.sh for Teleport Cloud users).
log in to your proxy:tsh login --proxy proxy.foo.example.com --user alice
generate the OpenSSH config for the proxy:tsh config --proxy proxy.foo.example.com
Append the resulting configuration snippet into your SSH config file located in the path below:
If using PowerShell on Windows to write your SSH config, note that normal shell redirection may write the file with the incorrect encoding. To ensure it's written properly, try the following:
tsh.exe config | out-file .ssh\config -encoding utf8 -append
You should be able to connect to the desired Node using the following command, replacing
user with the username you would like to assume on the Node:
The SSH config you generated earlier instructs your SSH client to run
tsh proxy ssh to access a Node in your Teleport cluster.
However, running an
ssh command against the Teleport Proxy Service at
yourtenant.teleport.sh will result in an error.
Teleport's certificates expire fairly quickly, after which SSH attempts will fail with an error like the following:
[email protected]: Permission denied (publickey). ERROR: exit status 255 kex_exchange_identification: Connection closed by remote host
When you see this error, re-run
tsh login to refresh your local certificate.
After opening your IDE go to
Browse Remote Host.
Then click the plus sign in the top-left corner to add a new server.
Enter a name for your new server.
Click the three dots next to
SSH configuration as in the picture above.
Create a new configuration by clicking the plus sign on the top left and providing:
Host- name of the Teleport Node.
Port- the Teleport Node's SSH port (3022 by default).
Username- the system username.
Authentication type pick
OpenSSH config and authentication agent.
Next, you can click
After closing the SSH configuration window, you should see
Remote Host menu in your IDE.
This guide makes use of
tsh config, added in Teleport 7.0; refer to the
dedicated guide for additional information.