|
| 1 | +.. _sif-networkdrive-msftp: |
| 2 | + |
| 3 | +Setup SSHFS with SFTP on macOS |
| 4 | +============================== |
| 5 | + |
| 6 | +.. _sif-networkdrive-applesilicon: |
| 7 | + |
| 8 | +Macs with Apple Silicon |
| 9 | +^^^^^^^^^^^^^^^^^^^^^^^ |
| 10 | + |
| 11 | +With the new Apple Silicon, Mac introduced more security and therefore restrictions to their computers. In order to use the program that SSHFS relies on, you will need to allow it to access the kernel extensions. |
| 12 | + |
| 13 | +You can follow the below guidelines to activate the kernel extensions for 3rd party programs, or contact your local IT department for assistance. |
| 14 | + |
| 15 | +First of all, make sure that this guide is handy, as you will have to restart your computer. Turn off your Mac and wait for it to turn off completely. A mac is completely shut down when the screen is black and all light (including Touch Bar) is turned off. |
| 16 | + |
| 17 | +After that, press the power button and hold it down until the "Loading setup options" text is shown. Click on "Options", then on "Continue". Select your user if you are asked to do so, and click "next". Input your computer's password when prompted. |
| 18 | + |
| 19 | +After getting into the menu, click on the "Utilities" button up on the top or similar button, before clicking on the "Startup Security Utility" button. Select your main system if you have several, and click "Unlock..." if prompted. Then. click on "Security Policy...". In this menu, you have to tick the "Reduced Security" rather than "Full Security", and tick the "Allow user management of kernel extensions from identified developers", click OK afterwards. |
| 20 | + |
| 21 | +You have now enabled kernel extensions, and can proceed with the main guide. Click on the Apple logo in the top-left to restart your computer. |
| 22 | + |
| 23 | + |
| 24 | +.. _sif-networkdrive-msftpsetup: |
| 25 | + |
| 26 | +Setup SSHFS |
| 27 | +----------- |
| 28 | + |
| 29 | +Log onto `SIF <https://sif.ku.dk/>`_ and click "Setup". |
| 30 | + |
| 31 | +Click on the SFTP tab, and create a password for your SFTP access in the field under "Password" or add a public SSH key. We recommend that you select a separate password than your main one for SIF. Click on "Save SFTP Settings" once done. |
| 32 | + |
| 33 | +.. TIP:: |
| 34 | + The password need to follow the University of Copenhagen's guidelines in terms of passwords, and be at least 12 symbols. |
| 35 | + |
| 36 | + |
| 37 | +.. _sif-networkdrive-msftpinstall: |
| 38 | + |
| 39 | +Install MacFUSE and SSHFS |
| 40 | +^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 41 | + |
| 42 | +With SSHFS set up on the SIF side, you now need to install the SSHFS client, which connects a SFTP-service as a network drive on your computer. |
| 43 | + |
| 44 | +You need to install SSHFS by downloading and running two programs: MacFUSE and SSHFS |
| 45 | + |
| 46 | +You can download the two programs from `this website <https://osxfuse.github.io/>`_. |
| 47 | + |
| 48 | +Open the programs, and follow the installation wizard for each program. |
| 49 | + |
| 50 | +Once you have installed both programs, you can finally connect SIF as a network drive. |
| 51 | + |
| 52 | +.. IMPORTANT:: |
| 53 | + If you have a newer Mac with Apple Silicon, then at the end of the installation you will be prompted to activate the kernel extension. A window will pop up, where you will be asked to open System Settings. Do so and click on the button that has appeared mentioning the program or an extension by "Benjamin Fleischer". After clicking this and being prompted your password, you will need to restart your computer once more to allow the kernel extension to load up as a starting process. |
| 54 | + |
| 55 | + |
| 56 | +.. _sif-networkdrive-msftpconnectnetwork: |
| 57 | + |
| 58 | +Connect Nerwork Drive |
| 59 | +^^^^^^^^^^^^^^^^^^^^^ |
| 60 | + |
| 61 | +Open an editor on your computer. (A free and easy tool for mac users is TextEdit, even if it is a rich text editor) |
| 62 | + |
| 63 | +Navigate to the Setup page once more for SFTP, and click on the fold-out menu "SSHFS/SFTP Network Drive", and copy the configuration in the box under "SSHFS Drive on Mac OSX". Insert the text into your editor of choice. If you chose a rich text editor such as TextEdit, then go into "Format" and click ""Make Plain Text". Save this configuration as "config" and make sure that it does not use .txt or similar extension after the file name, and save it as a Unicode file if you are prompted to select which type of file. You can save it on your Desktop for now. |
| 64 | + |
| 65 | +Afterwards, you need to open the terminal on your computer, which you can find via Spotlight search as "Terminal". |
| 66 | + |
| 67 | +.. TIP:: |
| 68 | + If a warning message pops up, simply click "OK" to allow "Terminal" to have access to the files. |
| 69 | + |
| 70 | + |
| 71 | +To create the folder ".ssh" in your "~" folder, which should be the location your terminal opened in, insert the command ``mkdir -p ~/.ssh`` before pressing Enter. Then, you want to insert the command ``touch ~/.ssh/config`` and press Enter to either create or update the timestamp on your config file. |
| 72 | + |
| 73 | +Now you can copy the contents from the file you created earlier into this config file by inserting the command ``cat ~/Desktop/config >> ~/.ssh/config`` into the Terminal before pressing Enter. |
| 74 | +This has the added bonus that even if ``config`` already exists, it will simply append the setup you've done onto it. |
| 75 | + |
| 76 | +After this is done, you need to mount with SSHFS, where one option is to use the following command:: |
| 77 | + |
| 78 | + mkdir -p sif-home && \ |
| 79 | + sshfs sif-io.erda.dk: sif-home -o idmap=user -o reconnect \ |
| 80 | + -o iosize=262144 |
| 81 | + |
| 82 | +Press Enter after inserting it into your terminal. First time you try to connect SIF with SFTP / SSHFS, you will be asked to verify the service's fingerprint. Here, you can check if the fingerprint in the terminal corresponds with the one on the SIF Setup page under "Login Details". Note that the fingerprint can have been updated since this guide was created, and feel free to contact our Support if that is the case. |
| 83 | + |
| 84 | +If it is the same fingerprint, then write ``yes`` and press Enter. You will then be prompted to write a password, and this will be the one you set up in the beginning of this guide. As a security measure, it will not be shown in the terminal, so simply type it and press Enter once done. |
| 85 | + |
| 86 | +SIF is now connected as a network drive and will be visible on the computer's desktop. You will now have access to all your data in SIF via your computer and if you are online, then you can work in the files in the same manner as your other local files, and when you save, those changes will be directly transmitted onto the files in SIF. |
| 87 | + |
| 88 | + |
| 89 | +.. _sif-networkdrive-msftperror: |
| 90 | + |
| 91 | +Error in the setup |
| 92 | +^^^^^^^^^^^^^^^^^^ |
| 93 | + |
| 94 | +In case of error in the setup, the SSHFS command will give you the message "remote host has disconnected" in the terminal. If this happens, you can try to test the setup by inserting the command ``sftp sif-io.erda.dk`` and press Enter. If you can log in after that, the setup is correct. |
| 95 | + |
| 96 | +If you still cannot log in, then you need to follow the terminal steps in this guide again, and if you continue to get errors, then you can write to our support at [email protected]. |
| 97 | + |
| 98 | +Before doing so, please run the command ``sftp -vvv sif-io.erda.dk`` and insert the result in the mail for us to troubleshoot. |
| 99 | + |
| 100 | + |
| 101 | +.. _sif-networkdrive-msftpdisconnect: |
| 102 | + |
| 103 | +Disconnect Network Drive |
| 104 | +------------------------ |
| 105 | + |
| 106 | +You can disconnect SIF as a network drive, and we recommend doing this if you share the computer with others. |
| 107 | + |
| 108 | +Right-click on the drive on the Desktop, and click "Push 'macFUSE Volume 0 (sshfs) out". |
| 109 | + |
| 110 | + |
| 111 | +.. _sif-networkdrive-msftpreconnect: |
| 112 | + |
| 113 | +Reconnect to the Network Drive |
| 114 | +------------------------------ |
| 115 | + |
| 116 | +When your computer has been turned off, you need to connect the network drive again. You do that by opening the terminal and running the sshfs command:: |
| 117 | + |
| 118 | + mkdir -p sif-home && \ |
| 119 | + sshfs sif-io.erda.dk: ucph-sif-home -o idmap=user -o reconnect \ |
| 120 | + -o iosize=262144 |
| 121 | + |
| 122 | +If you are experiencing problems in connection the network drive, then it may be because the network drive is connected but not visible. You can try to unmount the network drive by inserting the command ``diskutil unmount force ~/sif-home`` in the terminal and press Enter. After, you can try to connect the network drive again by running the sshfs command. |
| 123 | + |
| 124 | + |
| 125 | +WIP We are currently working on automating this step for our less technical users. |
0 commit comments