ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    How to mount remote filesystem over ssh (both Windows & Linux)

    IT Discussion
    sshfs windows linux ssh
    3
    7
    8.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 1
      1337
      last edited by 1337

      You can mount the filesystem of another server over SSH (using SFTP) both on linux and windows with sshfs (SSH File System).

      On the Windows client you have to install:

      • WinSfp - https://github.com/billziss-gh/winfsp/releases
      • SSHFS-Win https://github.com/billziss-gh/sshfs-win/releases

      To mount the server just map the network drive in the file explorer or with net use or whatever.
      Mount the root directory with \\sshfs.r\user@host

      On the linux client you mount it with the sshfs command.
      Syntax: sshfs [user@]hostname:[directory] mountpoint
      More on https://github.com/libfuse/sshfs

      Thought I'll share since I did this today and thought it might be useful for others as well.

      1 Reply Last reply Reply Quote 3
      • black3dynamiteB
        black3dynamite
        last edited by black3dynamite

        On Windows using Chocolatey.
        choco install sshfs
        choco install winfsp

        1 Reply Last reply Reply Quote 1
        • dafyreD
          dafyre
          last edited by

          This seems to work rather well... Wish I'd known about this a few months ago, lol!

          Anyhow, one thing I'm trying to figure out how to work out how to specify the folder I want to mount.

          IE: /var/www

          ... Any ideas?

          black3dynamiteB 2 Replies Last reply Reply Quote 1
          • black3dynamiteB
            black3dynamite @dafyre
            last edited by

            @dafyre said in How to mount remote filesystem over ssh (both Windows & Linux):

            This seems to work rather well... Wish I'd known about this a few months ago, lol!

            Anyhow, one thing I'm trying to figure out how to work out how to specify the folder I want to mount.

            IE: /var/www

            ... Any ideas?

            Using sshfs.r instead of sshfs should show the host root directory.

            02b7c79a-c225-4177-a9ad-2bbecf325a2e-image.png

            1 Reply Last reply Reply Quote 1
            • black3dynamiteB
              black3dynamite @dafyre
              last edited by black3dynamite

              @dafyre Installing sshfs and winfsp via choco is older than the ones from GitHub.

              If you installed them via choco do this to mount at the host root directory or other directories.
              https://github.com/billziss-gh/sshfs-win/issues/102

              Host root directory
              \\sshfs\remoteuser@host\..\..

              Specific directory like /var/www
              \\sshfs\remoteuser@host\..\..\var\www

              dafyreD 1 Reply Last reply Reply Quote 0
              • dafyreD
                dafyre @black3dynamite
                last edited by dafyre

                @black3dynamite said in How to mount remote filesystem over ssh (both Windows & Linux):

                @dafyre Installing sshfs and winfsp via choco is older than the ones from GitHub.

                If you installed them via choco do this to mount at the host root directory or other directories.
                https://github.com/billziss-gh/sshfs-win/issues/102

                Host root directory
                \\sshfs\remoteuser@host\..\..

                Specific directory like /var/www
                \\sshfs\remoteuser@host\..\..\var\www

                Thanks for the pointer. I did install using choco. I'm able to make it work now.

                Edit: Just to see if I can, I may go back and do straight installs.

                1 1 Reply Last reply Reply Quote 0
                • 1
                  1337 @dafyre
                  last edited by 1337

                  @dafyre said in How to mount remote filesystem over ssh (both Windows & Linux):

                  @black3dynamite said in How to mount remote filesystem over ssh (both Windows & Linux):

                  @dafyre Installing sshfs and winfsp via choco is older than the ones from GitHub.

                  If you installed them via choco do this to mount at the host root directory or other directories.
                  https://github.com/billziss-gh/sshfs-win/issues/102

                  Host root directory
                  \\sshfs\remoteuser@host\..\..

                  Specific directory like /var/www
                  \\sshfs\remoteuser@host\..\..\var\www

                  Thanks for the pointer. I did install using choco. I'm able to make it work now.

                  Edit: Just to see if I can, I may go back and do straight installs.

                  As I said above with the latest version I mount the root directory with \\sshfs.r\user@host

                  However, if you want to mount another directory like /var/www you have to do:
                  \\sshfs.r\user@host\var\www\
                  The trailing \ is very important!
                  It just doesn't work without it if your path is more than one directory deep. You also need to use backslash and not the forward slash.

                  1 Reply Last reply Reply Quote 1
                  • 1 / 1
                  • First post
                    Last post