Earlier, we talked about
SSH access to the Jelastic cloud and its features:
- SSH gateway as a new element of infrastructure
- generation and addition of SSH key to Jelastic account
- direct ssh container access
In this article, we would like to draw attention to some additional methods of SSH access to Jelastic containers, namely, using
SFTP (SSH File Transfer Protocol) or
FISH (Files transferred over Shell protocol) protocols. These protocols allow you to perform various operations from the file (access, transfer, etc.) over a secure channel.

Jelastic's
SFTP (Secure File Transfer Protocol) support is provided by implementing a streaming daemon to handle SFTP connections. This allows you to access, manage, and transfer files to a container through an SSH gateway, and thus be sure that your data is secure.
FISH protocol (Files transferred over Shell protocol) is supported by many popular FTP clients and file managers (for example, Midnight Commander, Konqueror, lftp, Krusader, etc.). This makes it possible to safely manage files in a container.
')
And now, let's look at some examples of the use of these protocols.
SFTP protocol
In order to access the required container via the
SFTP protocol , your local machine must have a private SSH key that corresponds
to the open account that was previously
added to Jelastic .
For Linux / MacOS users, this private key is automatically saved during key pair generation.
If you use Windows, then you need to additionally save the corresponding private key (as an example we use the PuTTYgen application):

Now you can start establishing an SFTP connection.
1. Start your FTP client with SFTP support.
For example, we will use the Filezilla program. Select
Edit> Settings in the application menu.

2. In the window that opens, go to the
SFTP section and, using the
Add keyfile button, select the previously saved private SSH key.
Click
OK .

3. After that, go to the menu item
File> Site Manager .

4. In the window that appears, click the
New site button and specify the following parameters:
- in the Host field, enter your SSH host (gate. { hoster_domain })
- in the Port field, insert the value 3022
- in the drop-down list of protocols, select SFTP
- set the Normal value for the Logon Type option
- In the User field, enter the Node ID of the container to access (this value can be found in the list of environment containers in a separate nodeid column using the SSH console), and add a User ID (a number before the @ character in the line for the SSH connection) using a hyphen .
Click
Connect .

5. Once the connection is established, you will see a list of folders in this container in the appropriate part of the program window.

That's all! Now you can start managing and transferring your application files through a secure channel.
FISH protocol
Let's consider an example of using
the FISH protocol to establish a secure connection between a remote container and the
Midnight Commander program.
1. To get started, make sure that your local machine has a private SSH key, which corresponds to the one that was previously added to the Jelastic control panel.
By default, the path to the generated key will be /
home /
afterusername// ssh /
id_rsa or
/ home /
keyuunamename// ssh /
id_dsa (depending on the type of key).
2. Check the ownership and attributes of your private key with the following commands:
- for RSA key
ls -la /home/{username}/.ssh/id_rsa - for dsa key
ls -la /home/{username}/.ssh/id_dsa
In the column of the owner of the key should be the
name of your user , and the attributes must be
400 or
600 . In other words, your key should not be readable by other users, otherwise the connection will not be established.
3. Install and run
Midnight Commander .
4. Call the menu panel by pressing the F9 key, and select the
Shell link item in the menu of the left or right tab.

5. In the opened
Shell link to machine dialog box, enter the following values with a hyphen:
- Node ID of the container to access (this value can be found in the list of environment containers in a separate nodeid column, using the SSH console)
- your line for SSH connection ( {user_id} @ {ssh_host}: 3022 )
Click
OK .

6. When the connection is completed, the files and folders of the container will be displayed in the selected panel (in our case, on the right).

Now you can safely manage the file system of your container using RSH commands. Good luck!
findings
Thus, using SFTP and FISH, you can manage files inside the container over a secure channel. As a bonus, you get extremely fast file transfer and the ability to manage the attributes of files and directories.
Try it yourself and see all the benefits of SSH access to Jelastic Cloud!