smb-auto-mount

v1.0.7

Auto-mount Windows SMB shares on Linux with systemd automount. Credentials entered interactively, never passed via command line. Requires sudo, cifs-utils (m...

1· 127·0 current·0 all-time
bySword-Art@swor-dart

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for swor-dart/smb-auto-mount.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "smb-auto-mount" (swor-dart/smb-auto-mount) from ClawHub.
Skill page: https://clawhub.ai/swor-dart/smb-auto-mount
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install smb-auto-mount

ClawHub CLI

Package manager switcher

npx clawhub@latest install smb-auto-mount
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the included scripts and required tools. Requiring sudo, cifs-utils, and smbclient is appropriate for auto-mounting SMB shares and editing /etc/fstab.
Instruction Scope
SKILL.md instructs the user to run the provided scripts which explicitly prompt for passwords and warn about modifying /etc/fstab. The scripts do modify system-wide configuration and create persistent credential files in /etc; this is expected for persistent mounts but is high-impact and should be reviewed before running.
Install Mechanism
No automated install; the skill is instruction/script-only. That keeps the risk low because nothing is downloaded or written automatically by an installer.
Credentials
No external environment variables or unrelated credentials are requested. The scripts rely on standard sudo-provided SUDO_UID/SUDO_GID values and prompt interactively for passwords, which aligns with the stated design to avoid command-line password exposure.
Persistence & Privilege
The scripts intentionally create persistent state (fstab entries and /etc/smb-creds-*.txt files) and enable systemd automount units; this is coherent with the feature but elevates persistence and must be run with root privileges. The skill itself is not forced-always and does not declare extra privileges, but running the scripts requires sudo.
Assessment
This skill appears to do exactly what it says: create on-demand systemd-mounted SMB shares and store credentials in /etc with root-only permissions. Before using it: (1) read the three scripts fully (they are included) and confirm you are comfortable with the exact changes to /etc/fstab and the creation of /etc/smb-creds-<name>.txt; (2) back up /etc/fstab (the README even suggests this); (3) test with the one-time mount first (mount-smb.sh) before adding persistent entries; (4) run locally from a trusted account — do not grant remote agents or automated services sudo that could run these scripts unattended; (5) after removing a persistent mount, delete its /etc/smb-creds-*.txt; and (6) if you prefer not to keep plaintext credential files under /etc, consider alternative credential storage (system keyring) or use ephemeral mounts. The scripts include input validation and use secure prompts, which is good practice; the main remaining risk is the expected system-level impact of modifying fstab and storing credentials as root-readable files.

Like a lobster shell, security has layers — review code before you run it.

cifsvk97dxv10gcjk56nbfs0jje58pn841zkalatestvk97dxv10gcjk56nbfs0jje58pn841zkamountvk97dxv10gcjk56nbfs0jje58pn841zkanetworkvk97dxv10gcjk56nbfs0jje58pn841zkasmbvk97dxv10gcjk56nbfs0jje58pn841zkawindowsvk97dxv10gcjk56nbfs0jje58pn841zka
127downloads
1stars
8versions
Updated 3w ago
v1.0.7
MIT-0

smb-auto-mount

Mount Windows SMB shares on Linux with on-demand automount.

⚠️ Security Notice: Passwords are entered interactively (secure prompt). Never pass passwords via command line arguments.


Security & Permissions / 安全与权限

⚠️ WARNING / 警告

  • Requires sudo/root: All scripts modify system-level configurations
  • Modifies /etc/fstab: Persistent changes to system mount configuration
  • Creates credential files: Stores passwords in /etc/smb-creds-*.txt (mode 600, root-only)
  • System impact: Incorrect usage may affect boot process

Recommendation / 建议: Review scripts before execution. Backup /etc/fstab if uncertain.

# Backup fstab before using add-to-fstab.sh
sudo cp /etc/fstab /etc/fstab.backup.$(date +%Y%m%d)

Dependencies / 依赖

# Required packages
sudo apt install cifs-utils smbclient

Scripts / 脚本

ScriptPurpose
list-shares.sh <ip> <username>List available shares
add-to-fstab.sh <ip> <share> <name> <username>Persistent automount
mount-smb.sh <ip> <share> <path> <username>One-time mount

Usage / 使用

⚠️ Passwords are entered interactively / 密码通过交互式输入

# 1. Discover shares
# Password will be prompted securely
sudo ./list-shares.sh 192.168.2.3 Administrator
Enter SMB Password: [hidden input]

# 2. Persistent automount (mounts on first access)
sudo ./add-to-fstab.sh 192.168.2.3 workspace my-work Administrator
Enter SMB Password: [hidden input]
ls /mnt/smb/my-work    # triggers mount

# 3. One-time mount
sudo ./mount-smb.sh 192.168.2.3 workspace /mnt/temp Administrator
Enter SMB Password: [hidden input]

How it works / 工作原理

  • noauto → not mounted at boot
  • x-systemd.automount → mounts on first access
  • credentials=/etc/smb-creds-*.txt → password not in fstab
  • Interactive password input → no command-line exposure

Files / 文件

  • Mountpoints: /mnt/smb/<name>/
  • Credentials: /etc/smb-creds-<name>.txt (mode 600, root-only)

中文说明

在 Linux 上自动挂载 Windows SMB 共享。按需挂载,凭证交互式输入,命令行不暴露密码。

安全警告

  • 需要 sudo/root 权限:修改系统级配置
  • 修改 /etc/fstab:持久化更改系统挂载配置
  • 创建凭证文件:密码存储在 /etc/smb-creds-*.txt(权限 600,仅 root 可读)
  • 系统影响:错误使用可能影响启动过程

建议:执行前审查脚本。不确定时备份 /etc/fstab

依赖

sudo apt install cifs-utils smbclient

使用

⚠️ 密码通过交互式安全输入,不通过命令行参数

# 1. 发现共享
# 密码会安全提示输入
sudo ./list-shares.sh 192.168.2.3 Administrator
Enter SMB Password: [隐藏输入]

# 2. 持久化挂载(首次访问时自动挂载)
sudo ./add-to-fstab.sh 192.168.2.3 workspace mywork Administrator
Enter SMB Password: [隐藏输入]
ls /mnt/smb/mywork    # 触发挂载

# 3. 一次性挂载
sudo ./mount-smb.sh 192.168.2.3 workspace /mnt/temp Administrator
Enter SMB Password: [隐藏输入]

工作原理

  • noauto → 启动时不挂载
  • x-systemd.automount → 首次访问时自动挂载
  • credentials=/etc/smb-creds-*.txt → fstab 中无密码
  • 交互式密码输入 → 命令行不暴露

文件

  • 挂载点:/mnt/smb/<name>/
  • 凭证文件:/etc/smb-creds-<name>.txt(权限 600,仅 root)

Comments

Loading comments...