📜 ⬆️ ⬇️

SFTP and FISH protocols for SSH access to Jelastic containers

Earlier, we talked about SSH access to the Jelastic cloud and its features:

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.

image

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):

image

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.

image

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 .

image

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

image

4. In the window that appears, click the New site button and specify the following parameters:

Click Connect .

image

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

image

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:

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.

image

5. In the opened Shell link to machine dialog box, enter the following values ​​with a hyphen:

Click OK .

image

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).

image

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!

Source: https://habr.com/ru/post/241846/


All Articles