The GenAP Workspaces are located within one of the Compute Canada Clouds and are securely isolated from other Workspaces, other CC clusters as well as the outside world. The only ways to access your Workspace storage are by 1) using one of the GenAP Web applications (notably the File Browser), 2) through a sFTP connection or 3) using SSHFS to mount your Workspace in your account on any Compute Canada resources (or on any unix account on a resource you have access to).
1) Using the File Browser application
2) Using the sFTP protocol
GenAP provides an sFTP access to your Workspaces allowing you to use the Unix "sftp" command line program, or graphical interface programs such as Filezilla, available on Unix, Windows and Mac OS. Also, it is possible to remotely "mount" your Workspace and attach it to a local directory using the "sshfs" command as described below.2.1) Generate your SSH keys locally
On Linux (or Unix) systemsGood instructions to generate your ssh keys can be found here: Using_SSH_keys_In_Linux.
Your public key will be located by default here:
$HOME/.ssh/id_rsa.pub
On Windows systems
You will find here the instructions to install SSH and generate your SSH keys on Windows 10: How to Generate SSH Key in Windows 10.
Your public key will be located by default here:
C:\Users\myusername\.ssh\id_rsa
2.2) Setup the SFTP service on the desired GenAP Workspace
-
Create a "File Browser" application in your Workspace and access it.
-
In the /ssh folder, you will find the file authorized-keys.txt. Click on it to edit the file. Some instructions are provided in the heading, including an example of commands to use a Unix sftp program to access this Workspace specifically.
-
Copy your SSH public key immediately after the line "# Your public keys:" (one key per line).
2.3) Setup and use any of the following client method
SFTP client (Unix/Linux command line)Once your public keys are in place (one per host from which you want to connect to the Workspace), simply use the following sftp command as stated in the file authorized-keys.txt. For example, to access the Workspace with a key name "abcxyz" located on Arbutus:
sftp -P 22004 sftp_abcxyz@sftp-arbutus.genap.ca
More information on using Unix sftp program: DigitalOcean Community: How to Use SFTP
Filezilla (Unix/Linux or Windows program)First download the application and install it on your desktop / laptop: Filezilla-project.org
In Filezilla:
- Go to File/Site Manager, and create a site
- Select SFTP protocol
- Enter the GenAP sftp host site corresponding to your Workspace site location (sftp-arbutus.genap.ca for example)
- Enter 22004 as port number
- Select "Key file" as the Logon Type
- Enter "sftp_abcxyz" as User (using the same Workspace keyname example as above)
- Enter where to find your local private "Key file:" (for example /home/your_login/.ssh/id_rsa)
- In the "Advanced" tab, check "Bypass proxy"
- Click "Connect".
You may receive a message saying the host is unknown the first time
you try to connect, simply accept the new host and ignore the warning.
SSHFS is a powerful program allowing you to mount a remote storage location on a local directory. Once mounted, you can navigate and manage your remote files (for instance in a GenAP Datahub) as if they were in your local Unix account. We will describe how to use it from any resources at Compute Canada (Compute Canada resources).
-
From your account on any of Compute Canada cluster login node, simply do the following (again using the same example of Workspace keyname as above "abcxyz" and where “my-sftp-remote-dir” could be a Datahub directly accessible on the Internet).
mkdir $HOME/my-sftp-remote-dir/
chmod a+r $HOME/my-sftp-remote-dir/
sshfs -p 22004 sftp_abcxyz@sftp-arbutus.genap.ca:/ $HOME/my-sftp-remote-dir/
-
If you wish to unmount your remote storage simply use the following command:
fusermount -u $HOME/my-sftp-remote-dir/
-
If you wish to install SSHFS and Fuse on your desktop/laptop and use it from there, here are quick instructions on how to get started: How To Use SSHFS to Mount Remote File Systems Over SSH
Important: This method is sometimes very slow, so it is not recommanded for large files.
-
Download and install WinFsp: WinFsp
Direct link to install file: winfsp-1.10.22006.msi
-
Download and install SSHFS-Win : SSHFS-Win
Direct link to install file: win-3.5.20357-x64.msi
-
Download and install SSHFS-Win-Manager: SSHFS-Win-Manager
Direct link to install file: sshfs-win-manager-setup-v1.3.1.exe
-
Run the SSHFS-Win Manager
- Click "Add Connection"
- Give it any name you want
- IP/Host: "sftp-arbutus.genap.ca"
- Port: 22004
- User: sftp_abcxyz (where abcxyz is the keyname of the Workspace to be connected)
- Authentication Method: Private Key (file)
- Key File: The location of your SSH private key file on Windows (ex: C:\Users\myusername\.ssh\id_rsa
- You can optionally select the drive letter.
- Click save
- Simply click the "Connection Icon" to connect
3) DATAHUB FILES LOCATION
Datahubs enable sharing your data on the Web. Each Datahub has its content in a distinct directory located in your Workspace.
The URL to access the files from the Internet can be decomposed and corresponds to the location in the /ftp/ directory.
URL: http://datahub-123-abcxyz.p.genap.ca ----> DATAHUB CONTENT IN: /ftp/datahub123/ of Workspace "abcxyz"
4) FILES PERMISSION
The files you copy in a datahub must be readable by all so the Datahub server can read them.
You can change the permission using the Unix command chmod from the source computer
before copying the files:
-
For one file: chmod a+r my_file
-
For an entire directory and all its content recursively: chmod -R a+r my_dir
Note : to change the permission of files already transferred, the chmod command can still be used through the sftp command, but using the numeric rather than symbolic options (e.g. “chmod 744 my_file”). More information on Unix permission: An Introduction to Linux Permissions