956
技术社区[云栖]
【Linux sshfs】sshfs将远程目录挂载到本地目录
#ssh-keygen -t rsa
#cat .ssh/id_rsa.pub | ssh [remote_user]@[remote_server] "cat - >>.ssh/authorized_keys"
#cat .ssh/id_rsa.pub | ssh [remote_user]@[remote_server] "cat - >>.ssh/authorized_keys"
注:无密码ssh登录的基本原理是,在本地的root用户下,用ssh-keygen命令生成一对密钥,然后将其中的公钥,追加到远程服务器的authorized_keys文件中即可。密钥对只对本地的生成用户有效,其他用户需要重新生成并添加。
3、挂载远程 ssh 文件系统
#sshfs gintama@172.31.30.57:/data/jdsdk/runtime/ /data/app_data/sdk/redis/
sshfs [user@]host:[dir] mountpoint [options]
前面和ssh命令一样,mountpoint是挂载点
options重点关注下:
-C 压缩,或者-o compression=yes
-o reconnect 自动重连
-o transform_symlinks 表示转换绝对链接符号为相对链接符号
-o follow_symlinks 沿用服务器上的链接符号
-o cache=yes
options重点关注下:
-C 压缩,或者-o compression=yes
-o reconnect 自动重连
-o transform_symlinks 表示转换绝对链接符号为相对链接符号
-o follow_symlinks 沿用服务器上的链接符号
-o cache=yes

#sudo sed -i '$a\' /etc/fstab

6、fuse: failed to exec fusermount: Permission denied错误解决
最后更新:2017-07-24 23:02:45