Linux: Connecting via FTP

Published

Here we will review connecting to the Peerobyte  cloud data storage via Nautilus and Midnight Commander file managers, and via the Linux terminal using the FTP protocol in Linux OS. As an example, we have taken the process of connecting FTP storage in Ubuntu 20.04; for other Linux-based operating systems the steps will be quite similar.

Prerequisites

  1. You must have a Peerobyte account, with your email address and phone number verified. For details on how to complete this process, refer to the instructions in the guide: "Creating an Account".
  2. You must order cloud data storage. The process of ordering cloud storage is outlined in the guide: "How to Order Cloud Data Storage".
  3. You must receive an email or a notification in your Peerobyte dashboard informing you that your ordered storage is ready for use.
  4. You must have a device running a Linux-based operating system.
  5. Port 21 must be open on the device you intend to use for connecting.

Connection Details

Before you connect to the cloud storage, you need to get the connection details, that is: IP address of the storage, username and password. You will receive all the necessary connection details in the email when your data storage is ready for operation. You can also get them in the Peerobyte cloud storage control panel by following the steps below:

1. Sign in to the Peerobyte control panel, if you haven't done so already. Instructions for logging in are provided in the following guides:

a. If two-factor authentication (2FA) is not enabled on your account: "Signing in to the Control Panel".

b. If 2FA is enabled on your account: "2FA Signing in to the Control Panel".

2. Click on the Services item on the main menu in the Control Panel.
This will open the My Products & Services list.

3. Select the storage you want to connect to from the Product/Service list by clicking in its row.

You will be redirected to the control panel of your chosen cloud storage.

4. Verify that the FTP protocol is enabled.

If the FPT row has the In Use status, then go to step 5. If the status is Not Used, then you must enable the FTP protocol to access the storage by clicking the Enable button in the FTP row.

FTP access to your storage will be allowed.

5. The information you need can be obtained in two ways:

a. In the Access Details section of the Account information block.

b. Or you can click Access Details in the FTP row of the Services tab of the Service Management block.

The FTP Access Details window that opens will also display the connection details.

So, you have Primary IP or Server IP values, which are the IP address to connect to the storage and the username and password to access the cloud storage. Now you are ready to connect to the cloud storage.

Connecting via the Nautilus File Manager (Files)

Working with cloud data storage via FTP is most comfortable using file managers. In this section, we will review the steps to connect to the storage using one of the most popular file manager, Nautilus.

Nautilus requires an installed graphical user interface (GUI) in your operating system. Without a GUI, Nautilus won't work. If you do not have the GUI installed, install it or use an FTP connection through other programs such as Midnight Commander file manager or directly from the Linux terminal. Instructions for connecting using Midnight Commander and the terminal are given in the next section of these instructions.

To connect to FTP using Nautilus, follow these steps:

1. Install Nautilus.

Some versions of operating systems already have Nautilus installed, but if you don't have it, you can install it from the terminal using the commands below. 

To install Nautilus, start a Linux terminal using the Ctrl+Alt+T key combination. In the terminal, enter the commands appropriate for your version of the operating system:

    		
    sudo apt install nautilus

      		
      sudo dnf install nautilus

        		
        sudo yum install nautilus

          		
          sudo pacman -S nautilus

            		
            sudo zypper install nautilus

              		
              sudo dnf install nautilus

                		
                sudo yum install nautilus

                2. Launch the Nautilus file manager (Files).

                a. Click the Activities button in the upper left corner of the screen.

                b. Click the Nautilus (Files) application icon.

                The Nautilus file manager window opens.

                3. Specify the storage address.

                a. Go to the tab of the file manager +Other Locations.

                b. Enter in the Connect to Server field the following characters: ftp:// and the value of the Primary IP or Server IP field obtained in the Connection Details section.

                c. Then click the Connect button.

                The connection authentication settings window will open.

                4. Enter the credentials to authenticate as a storage user.

                a. Select Registered User from the Connect As list.

                b. Enter the cloud storage username you received in the Connection Details section in the Username field.

                c. Enter the password you received in the Connection Details section in the Password field.

                d. Select the method of storing the password for the connection:
                - Forget password immediately - the password was used once and immediately forgotten by the file manager - this is the most secure, but not convenient to work with.
                - Remember password until you logout - the file manager will remember the password to your connection until the end of the current session. 
                - Remember forever - the file manager will remember the password to your connection forever.

                e. Click the Connect button.

                If the connection details are entered incorrectly, an error will be displayed after clicking the Connect button: "Unable to access location". In this case, check the connection details and enter them again.

                In case of successful connection and authentication, the NAS window will open.

                Connecting via Midnight Commander

                One of the advantages of the Midnight Commander (MC) file manager is its ability to work via terminal or console of the Peerobyte control panel, as well as when connecting to a server via OpenSSH, for example, using PowerShell. It does not require the installation of a graphical user interface (GUI).

                To connect to FTP via MC, follow the steps below:

                1. Install Midnight Commander.

                Use the commands appropriate for your version of Linux for installation:

                  		
                  sudo apt update sudo apt install mc

                    		
                    sudo dnf install mc

                      		
                      sudo yum install mc

                        		
                        sudo pacman -S mc

                          		
                          sudo zypper install mc

                            		
                            sudo dnf install mc

                              		
                              sudo yum install mc

                                		
                                sudo apk add mc

                                2. Launch the MC file manager with the command:

                                		
                                sudo mc

                                3. Start setting up the FTP connection.

                                a. Press the F9 key on your keyboard.
                                This will take you to the MC main menu.

                                b. Use the (Left) or (Right) keys to select the Left or Right panel where you want to open the storage.

                                c. Use the (Down) or (Up) keys on the keyboard to select the FTP Link... menu item and press Enter on the keyboard.

                                The window for creating an FTP connection will open.

                                4. Specify the user and FTP address.

                                a. In the Enter machine name field, enter a string like this:

                                		
                                ftp://<User_Name>@<Server_IP>:21

                                Use the username and IP address of the server obtained in the Connection Details section.

                                In our case it looked as follows:

                                b. Press the Enter key on your keyboard.
                                A window for entering the password will open.

                                5. Specify the storage user password.

                                a. In the Password field, enter the storage user password obtained in the Connection details section.

                                b. Press the Enter key on your keyboard.
                                Your storage will open in the window you selected.

                                In case the connection attempt fails, check the correctness of the entered data, IP address, password and username.

                                Connecting via Linux Terminal

                                Connecting via a Linux terminal is not as user-friendly as using a file manager because it requires command-line operations. However, this method is more versatile since the FTP client is included in most Linux distributions, and you won't need to install anything additional, nor will you need a graphical user interface (GUI).

                                Connecting to the Server

                                To connect to the server, we will use the following command format:

                                		
                                FTP <Primary IP or Server IP>

                                Insert the value of Primary IP or Server IP that we obtained in the previous section, resulting in the following command:

                                		
                                FTP 198.51.100.34

                                In response to our command, we will be prompted to enter the storage username. After entering the username, we will need to enter the password for the cloud data storage. The password will not be displayed, so be careful with the case of the characters. For our storage, it will look like this:

                                		
                                netadmin@657c45df0f122:~$ ftp 198.51.100.34 Connected to 198.51.100.34. 220 ProFTPD Server (nas FTP Server) [::ffff:198.51.100.34] Name (198.51.100.34:netadmin): pipogycz 331 Password required for pipogycz Password: 230-Welcome to TrueNAS FTP Server 230 User pipogycz logged in Remote system type is UNIX. Using binary mode to transfer files.ftp;

                                If, after attempting to connect, you see the ftp> prompt, then the connection to the data storage via the FTP protocol was successful, and you can work with it using commands.

                                Commands

                                To display a list of available commands, you can use the help command. Then, for any command displayed on the screen, you can get more information by using the command format:

                                		
                                help <command>

                                Here are the commands that may be useful for working with cloud data storage via FTP in the terminal:

                                ls - displays a list of directories and files in the current directory.

                                cd <path to new directory> - moves you to a new directory.

                                lcd <path to new directory> - moves you to a new directory on the machine from which you are connected to the storage.

                                pwd - displays the path to the current directory.

                                mkdir <directory name> - creates a new directory in the current storage directory.

                                rmdir <directory name> - deletes a directory from the current storage directory.

                                get <file name> [<new file name>] - downloads a file from the current storage directory and saves it to the current directory on the machine from which you are connected to the storage. Optionally, you can rename the downloaded file.

                                mget <file name> [<file name>...] | <filter> - downloads a group of files that you explicitly list or specify by a filter from the current storage directory and saves them to the current directory on the machine from which you are connected to the storage. For example, the mget * command will download all files from the current storage directory. You need to confirm the download of each file by pressing y or cancel by pressing n.

                                put <file name> - uploads a file from the current directory on the machine from which you are connected to the current storage directory.

                                mput <file name> [<file name>...] | <filter> - uploads a group of files that you explicitly list or specify by a filter from the current directory on the machine from which you are connected to the current storage directory. For example, the mput * command uploads all files from the current directory on the machine to the storage. You need to confirm the upload of each file by pressing y or cancel by pressing n.

                                delete <file name> - deletes the specified file from the current storage directory.quit - ends the FTP session with the storage.