說明:sshfs可以幫助本地mac訪問虛擬機上的共享文件夾,從而操作虛擬機上的文件夾非常方便
1、安裝sshfs
sudo port install sshfs
2、使用,指定遠程目錄,到本地某一目錄share
sshfs root@10.0.6.**:/home/www/blogApi ./
3、取消掛載,當需要取消掛載時,使用:fusermount -u share_path_dir 並不成功,提示fusermount命令找不到,使用umount share_path_dir即可
umount share
此處參考:https://www.jianshu.com/p/31205b26deff
4、當發現再次進入目錄報錯,或者取消掛載umount dir失敗時,需要殺掉相應進程:
根據名稱查詢進程
pgrep -lf sshfs
殺死進程
pkill -9 sshfs
5、當發現share文件夾的權限所有組,所有者不對時,修改
chown -R admin:admin share