简单好用的sshfs -- 通过ssh映射远程路径(转)
生活随笔
收集整理的這篇文章主要介紹了
简单好用的sshfs -- 通过ssh映射远程路径(转)
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
最近習(xí)慣性訪問(wèn)N個(gè)Linux機(jī)器,在不同機(jī)器間跳來(lái)跳去,很是麻煩,最終,找到了sshfs,可以把遠(yuǎn)程目錄直接映射到本地,無(wú)需修改遠(yuǎn)程機(jī)器的設(shè)置,僅要求有ssh連接的權(quán)限(ssh都沒(méi)有的話,還能干啥?!~!)
官網(wǎng)地址:?http://fuse.sourceforge.net/sshfs.html
安裝:
#如果是ubuntu apt-get install sshfs #如果是Fedore yum install fuse-sshfs #如果是CentOS,貌似只能自己安裝了 wget http://nchc.dl.sourceforge.net/project/fuse/sshfs-fuse/2.4/sshfs-fuse-2.4.tar.gz tar xvf sshfs-fuse-2.4.tar.gz cd sshfs-fuse-2.4./configure #如果缺glib2什么的,就自行裝上 make install先看看選項(xiàng):
general options:-o opt,[opt...] mount options-h --help print help-V --version print versionSSHFS options:-p PORT equivalent to '-o port=PORT'-C equivalent to '-o compression=yes'#啟用壓縮,建議配上-F ssh_configfile specifies alternative ssh configuration file #使用非默認(rèn)的ssh配置文件-1 equivalent to '-o ssh_protocol=1'#不要用啊-o reconnect reconnect to server #自動(dòng)重連-o delay_connect delay connection to server-o sshfs_sync synchronous writes-o no_readahead synchronous reads (no speculative readahead)#提前預(yù)讀-o sshfs_debug print some debugging information-o cache=BOOL enable caching {yes,no}(default: yes)#能緩存目錄結(jié)構(gòu)之類(lèi)的信息-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 workaround=LIST colon separated list of workaroundsnone no workarounds enabledall all workarounds enabled[no]rename fix renaming to existing file (default: off)[no]nodelaysrv set nodelay tcp flag in sshd (default: off)[no]truncate fix truncate for old servers (default: off)[no]buflimit fix buffer fillup bug in server (default: on)-o idmap=TYPE user/group ID mapping, possible types are:#文件權(quán)限uid/gid映射關(guān)系none no translation of the ID space (default)user only translate UID of connecting user-o ssh_command=CMD execute CMD instead of 'ssh'-o ssh_protocol=N ssh protocol to use(default:2)#肯定要2的-o sftp_server=SERV path to sftp server or subsystem (default: sftp)-o directport=PORT directly connect to PORT bypassing ssh-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)Module options:[subdir]-o subdir=DIR prepend this directory to all paths (mandatory)-o [no]rellinks transform absolute symlinks to relative[iconv]#字符集轉(zhuǎn)換,對(duì)我這種UTF8控,默認(rèn)已經(jīng)是最好的-o from_code=CHARSET original encoding of file names (default: UTF-8)-o to_code=CHARSET new encoding of the file names (default: UTF-8)實(shí)際使用:
掛載(如果配上ssh key就可以完全自動(dòng)化了): sshfs root@192.168.9.109:/opt /opt/s109 卸載: fusermount -u /opt/s109?
轉(zhuǎn)載于:https://www.cnblogs.com/xiangxiaodong/p/3752515.html
總結(jié)
以上是生活随笔為你收集整理的简单好用的sshfs -- 通过ssh映射远程路径(转)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Java连接Access数据库的那些坑
- 下一篇: AsyncTask理解- Day36or