Debian使用sshfs将StorageBox挂载到本地
274 字
1 分钟
Debian使用sshfs将StorageBox挂载到本地
1.debian安装sshfs
sudo apt update -ysudo apt install sshfs -y2.确认是否安装成功
sshfs --version返回如下显示版本号即安装成功
SSHFS version 3.7.33.创建本地挂载目录
sudo mkdir -p /mnt/storage4.创建密码文件
mkdir -p /root/.config/sshfsnano /root/.config/sshfs/storagebox.passstoragebox.pass里面只放你的StorageBoxd的sftp密码 保存后:
chmod 600 /root/.config/sshfs/storagebox.pass5.先手动测试挂载
sshfs username@:your-storage-box.domain:/ /mnt/storage \ -p 22 \ #sftp端口 -o password_stdin \ < /root/.config/sshfs/storagebox.pass6.验证是否挂载成功
ls -lah /mnt/storage如果能够看到Storage Box的目录,就成功了。
7.(可选)使用脚本快速挂载
1.创建脚本
nano storagebox-sshfs.sh写入:
#!/bin/bash
cat /root/.config/sshfs/storagebox.pass | /usr/bin/sshfs \ username@:your-storage-box.domain:/ /mnt/storage \ -p 22 \ -o password_stdin \ -o reconnect \ -o ServerAliveInterval=15 \ -o ServerAliveCountMax=32.添加执行权限
chmod 700 storagebox-sshfs.sh3.先确保挂载目录存在
ls -lah /mnt/storage #查看目录是否存在mkdir -p /mnt/storage #如果不存在则创建目录4.执行
./storagebox-sshfs.sh如果之前其他方式挂载过,先执行以下命令取消挂载再执行脚本
fusermount3 -u /mnt/storage5.验证是否挂载成功
ls -lah /mnt/storage如果能够看到Storage Box的目录,就成功了。
文章分享
如果这篇文章对你有帮助,欢迎分享给更多人!
相关文章智能推荐
1
Firefly 代码块示例
文章示例在Firefly中使用表达性代码的代码块在 Markdown 中的外观。
2
Firefly 布局系统详解
文章示例深入了解 Firefly 的布局系统,包括侧边栏布局(左侧/双侧)和文章列表布局(列表/网格),以及自适应网格列数。
3
Firefly Wiki Link 内部链接示例
文章示例在 Firefly 文章中使用 Obsidian 风格的 Wiki Link 内部链接,并自动生成文章链接卡片。
4
Firefly 简单使用指南
文章示例如何使用 Firefly 博客模板。
5
Firefly 一款清新美观的 Astro 博客主题模板
文章示例Firefly 是一款基于 Astro 框架和 Fuwari 模板开发的清新美观且现代化个人博客主题模板,专为技术爱好者和内容创作者设计。该主题融合了现代 Web 技术栈,提供了丰富的功能模块和高度可定制的界面,让您能够轻松打造出专业且美观的个人博客网站。
随机文章随机推荐


