Configure FTP

in Usage Tags: FTPSSH

For some shops FTP usage is required to access an external data supplier. For these customers we’ve added the feature to add and remove FTP users on your Hypernode. In this article we’ll explain how you can configure FTP (create/delete users) and which credentials to use to make a FTP connection.

NB: We strongly recommend using SSH or SFTP for file transfers. FTP is an inherently unsafe protocol, and should only be used for syncing data with suppliers that can’t be done through the Magento API.

Managing FTP users

Adding FTP users

The first step is to create a FTP user on your Hypernode. This is done through the hypernode-ftp add command. The syntax of this command is as follows:

hypernode-ftp add --username USER --homedir DIRECTORY

For example if you want to create user bob with homedir /data/web:

hypernode-ftp add --username bob --homedir /data/web/

You will be asked for a password and after adding a password the user is created. This creates the user bob which it’s restricted to the folder /data/web/public and everything that’s in it.

Deleting FTP users

If you want to delete a FTP user you can use the hypernode-ftp remove command. The syntax of this command is as follows:

hypernode-ftp remove --username USER

We could delete the bob user by using the command like this:

hypernode-ftp remove --username bob

Listing all FTP users

If you want to check which FTP users are enabled you can use the hypernode-ftp list command. This command returns a list of all available users and their particular homedir:

Users found:
bob   /data/web/

Or in case you did not add any FTP users yet:

No users in ftpasswd file

Adding Your IP Address to the whitelist

Because FTP is heavily firewalled on Hypernodes, you need to add your local IP address to the firewall whitelist in our Service Panel.

To find out what your IP address is, search for “what is my IP” on Google. 
After adding your IP to the firewall whitelist, it can take a few minutes until the changes are configured on the server, so if you keep experiencing a timeout, have a coffee before you try again.

Connecting to FTP

If you want to connect to FTP you’ll have to use the following credentials:

  • Hostname: appname.hypernode.io (replace this with the name of your Hypernode)
  • User: Your username
  • Password: Your password
  • Port:
    • 21 For regular FTP
    • 2222 For SFTP (you need to opt-in first!)

ACTIVE mode or PASSIVE mode

ACTIVE and PASSIVE mode are 2 techniques for establishing an FTP connection with an FTP server.

FTP uses two channels between client and server, the command channel and the data channel, which are actually separate TCP connections. The command channel is for commands and responses, the data channel is for transferring files.

In active mode, the client establishes the command channel (from client port X to server port 21) but the server establishes the data channel (from server port 20 to client port Y, where Y has been supplied by the client).

In passive mode, the client establishes both channels. In that case, the server tells the client which port should be used for the data channel.

Passive mode is generally used in situations where the FTP server is not able to establish the data channel. One of the major reasons for this is network firewalls. While you may have a firewall rule which allows you to open up FTP channels to appname.hypernode.io, the Hypernode FTP daemon may not have the power to open up the data channel back through your firewall.

Passive mode solves this by opening up both types of channel from the client side.

If you are behind a router or firewall, switching to passive mode is a genuine fix for almost all connectivity problems when using FTP. If you experience connectivity errors, try switching from passive to active mode or vice versa.

SFTP (SSH File Transfer Protocol)

We also offer SFTP on Hypernodes. SFTP allows you to securely copy files from and to the Hypernode using tools like scp and sftp and it’s windows equivalent WinSCP. This is done over a secure encrypted connection and still restricts users to a specific directory using the same mechanism as with FTP users.

If you wish to use SFTP, please send an email to support@byte.nl with the names of your Hypernodes we should enable this feature for. More information on SFTP can be found here.

After you received the confirmation from our support team that SFTP support has been enabled on your Hypernode, you can connect using the SFTP protocol, on port 2222, using the same credentials as with regular FTP connections.

Troubleshooting

  • When using SFTP, you are always chrooted to the homedir. This implies that when you want to copy a file to /tmp, you will receive an error, as the tmp/ directory does not exist in the configured homedir..

  • If you experience a ‘Connection timed out’ error, please check in our service panel if your IP address is whitelisted.

    • If the IP is whitelisted and you still get this error: Check your local firewall and antivirus logs.

14