sshfs 指令备忘
sshfs 指令备忘
以下所有指令基于 $macOS$ ,$Linux$ 类似。
挂载远程目录到本地
1
2
3
4
5
6
sshfs -p <port> -C -o reconnect <user>@<hostname>:<remote_dir> <local_dir>
## <port> 端口号
## <user> 用户名
## <hostname> 远程地址
## <remote_dir> 远程路径
## <local_dir> 本地挂载路径
取消挂载
1
umount -f <local_dir>
有时候会因为一些特殊原因,比如说电脑进入睡眠,导致链接断开,这个时候就会出现无法取消挂载的情况,考虑强制取消或杀掉进程。
强制取消
1
diskutil umount force <local_dir>
杀掉进程
1
2
pgrep -lf sshfs
pkill -9 sshfs
This post is licensed under CC BY 4.0 by the author.