ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • mac에서 sFTP/ssh 파인더에 마운트하기
    apple/mac 2018. 5. 7. 16:55

    윈도우에 RaiDrive처럼 맥에도 비슷한 프로그램인 expandrive가 있는데 유료(50USD)로 보입니다.


    https://www.expandrive.com/




    검색하여 보니 아래의 방법으로 무료 이용이 가능하였습니다.(CLI)


    1. 터미널 실행


    2. brew cask install osxfuse 


    HAPPYuiiMac:~ happy$ brew cask install osxfuse

    ==> Tapping caskroom/cask

    Cloning into '/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask'...

    remote: Counting objects: 4063, done.

    remote: Compressing objects: 100% (4043/4043), done.

    remote: Total 4063 (delta 29), reused 654 (delta 16), pack-reused 0

    Receiving objects: 100% (4063/4063), 1.40 MiB | 447.00 KiB/s, done.

    Resolving deltas: 100% (29/29), done.

    Tapped 0 formulae (4,071 files, 4.4MB)

    ==> Creating Caskroom at /usr/local/Caskroom

    ==> We'll set permissions properly so we won't need sudo in the future

    Password:

    ==> Caveats

    To install and/or use osxfuse you may need to enable their kernel extension in


      System Preferences → Security & Privacy → General


    For more information refer to vendor documentation or the Apple Technical Note:


      https://developer.apple.com/library/content/technotes/tn2459/_index.html


    You must reboot for the installation of osxfuse to take effect.


    ==> Satisfying dependencies

    ==> Downloading https://github.com/osxfuse/osxfuse/releases/download/osxfuse-3.7

    ######################################################################## 100.0%

    ==> Verifying checksum for Cask osxfuse

    ==> Installing Cask osxfuse

    ==> Running installer for osxfuse; your password may be necessary.

    ==> Package installers may write to any location; options such as --appdir are i

    ==> installer: Package name is FUSE for macOS

    ==> installer: choices changes file '/var/folders/yq/vsh4yl1520sb78f16r3615k0000

    ==> installer: Installing at base path /

    ==> installer: The install was successful.

    ==> Changing ownership of paths required by osxfuse; your password may be necess

    🍺  osxfuse was successfully installed! 


    3. brew install sshfs


    HAPPYuiiMac:~ happy$ brew install sshfs

    ==> Installing dependencies for sshfs: gettext, libffi, pcre, glib

    ==> Installing sshfs dependency: gettext

    ==> Downloading https://homebrew.bintray.com/bottles/gettext-0.19.8.1.high_sierra.bottle.tar.gz

    ######################################################################## 100.0%

    ==> Pouring gettext-0.19.8.1.high_sierra.bottle.tar.gz

    ==> Caveats

    This formula is keg-only, which means it was not symlinked into /usr/local,

    because macOS provides the BSD gettext library & some software gets confused if both are in the library path.


    If you need to have this software first in your PATH run:

      echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile


    For compilers to find this software you may need to set:

        LDFLAGS:  -L/usr/local/opt/gettext/lib

        CPPFLAGS: -I/usr/local/opt/gettext/include


    ==> Summary

    🍺  /usr/local/Cellar/gettext/0.19.8.1: 1,935 files, 16.9MB

    ==> Installing sshfs dependency: libffi

    ==> Downloading https://homebrew.bintray.com/bottles/libffi-3.2.1.high_sierra.bottle.tar.gz

    ######################################################################## 100.0%

    ==> Pouring libffi-3.2.1.high_sierra.bottle.tar.gz

    ==> Caveats

    This formula is keg-only, which means it was not symlinked into /usr/local,

    because some formulae require a newer version of libffi.


    For compilers to find this software you may need to set:

        LDFLAGS:  -L/usr/local/opt/libffi/lib


    ==> Summary

    🍺  /usr/local/Cellar/libffi/3.2.1: 16 files, 297.0KB

    ==> Installing sshfs dependency: pcre

    ==> Downloading https://homebrew.bintray.com/bottles/pcre-8.42.high_sierra.bottle.tar.gz

    ######################################################################## 100.0%

    ==> Pouring pcre-8.42.high_sierra.bottle.tar.gz

    🍺  /usr/local/Cellar/pcre/8.42: 204 files, 5.3MB

    ==> Installing sshfs dependency: glib

    ==> Downloading https://homebrew.bintray.com/bottles/glib-2.56.1.high_sierra.bottle.tar.gz

    ######################################################################## 100.0%

    ==> Pouring glib-2.56.1.high_sierra.bottle.tar.gz

    🍺  /usr/local/Cellar/glib/2.56.1: 430 files, 23.7MB

    ==> Installing sshfs

    ==> Downloading https://homebrew.bintray.com/bottles/sshfs-2.10.high_sierra.bottle.tar.gz

    ######################################################################## 100.0%

    ==> Pouring sshfs-2.10.high_sierra.bottle.tar.gz

    🍺  /usr/local/Cellar/sshfs/2.10: 6 files, 94.4KB 



    4. sshfs -h  (사용 법)


    general options:

        -o opt,[opt...]        mount options

        -h   --help            print help

        -V   --version         print version


    SSHFS options:

        -p PORT                equivalent to '-o port=PORT'

        -C                     equivalent to '-o compression=yes'

        -F ssh_configfile      specifies alternative ssh configuration file

        -1                     equivalent to '-o ssh_protocol=1'

        -o reconnect           reconnect to server

        -o delay_connect       delay connection to server

        -o sshfs_sync          synchronous writes

        -o no_readahead        synchronous reads (no speculative readahead)

        -o sync_readdir        synchronous readdir

        -o sshfs_debug         print some debugging information

        -o cache=BOOL          enable caching {yes,no} (default: yes)

        -o cache_max_size=N    sets the maximum size of the cache (default: 10000)

        -o cache_timeout=N     sets timeout for caches in seconds (default: 20)

        -o cache_X_timeout=N   sets timeout for {stat,dir,link} cache

        -o cache_clean_interval=N

                               sets the interval for automatic cleaning of the

                               cache (default: 60)

        -o cache_min_clean_interval=N

                               sets the interval for forced cleaning of the

                               cache if full (default: 5)

        -o workaround=LIST     colon separated list of workarounds

                 none             no workarounds enabled

                 [no]rename       fix renaming to existing file (default: off)

                 [no]truncate     fix truncate for old servers (default: off)

                 [no]buflimit     fix buffer fillup bug in server (default: on)

                 [no]fstat        fix fstat for old servers (default: off)

        -o idmap=TYPE          user/group ID mapping (default: user)

                 none             no translation of the ID space

                 user             only translate UID/GID of connecting user

                 file             translate UIDs/GIDs contained in uidfile/gidfile

        -o uidfile=FILE        file containing username:remote_uid mappings

        -o gidfile=FILE        file containing groupname:remote_gid mappings

        -o nomap=TYPE          with idmap=file, how to handle missing mappings

                 ignore           don't do any re-mapping

                 error            return an error (default)

        -o ssh_command=CMD     execute CMD instead of 'ssh'

        -o ssh_protocol=N      ssh protocol to use (default: 2)

        -o sftp_server=SERV    path to sftp server or subsystem (default: sftp)

        -o directport=PORT     directly connect to PORT bypassing ssh

        -o slave               communicate over stdin and stdout bypassing network

        -o disable_hardlink    link(2) will return with errno set to ENOSYS

        -o transform_symlinks  transform absolute symlinks to relative

        -o follow_symlinks     follow symlinks on the server

        -o no_check_root       don't check for existence of 'dir' on server

        -o password_stdin      read password from stdin (only for pam_mount!)

        -o SSHOPT=VAL          ssh options (see man ssh_config)


    FUSE options:

        -d   -o debug          enable debug output (implies -f)

        -f                     foreground operation

        -s                     disable multi-threaded operation


    fuse: no mount point 



    5. 제가 사용한 명령 줄 

     5-1. /Users/happy/에 remote란 폴더를 생성

     5-2. 터미널에서 아래 명령어 실행


    sshfs happy@file.sample.com:/ /Users/happy/remote/ -p 22 -ovolname=Vol1



     5-3. yes 입력 후 엔터


    The authenticity of host '[file.sample.com]:22 ([123.123.123.4]:22)' can't be established.

    ECDSA key fingerprint is SHA256:ARCigDmq7QZzhFUk+2sk4fpRuL0c43XHwPjbzsqRjCk.

    Are you sure you want to continue connecting (yes/no)? yes  


     5-4. sFTP 암호 입력


    happy@happy.sample.com's password: 


    6. 파인더를 열어보면 원격지에 파일이 sFTP로 마운트되어 로컬폴더처럼 보이면 성공입니다.






    댓글 0

Designed by Tistory.