Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🖥️ samba-manager

An interactive terminal UI (TUI) for managing Samba shares on Linux — built for Raspberry Pi but works on any Debian/Ubuntu system.

Python Platform License


Features

  • Device & UUID Table — see all connected block devices, filesystems, UUIDs, mount status, fstab presence and Samba share status in one view
  • Share Overview — list all current Samba shares from smb.conf with matched UUID, path, and mount status
  • Add Share Wizard — guided 6-step wizard to:
    • Select device from a list
    • Set/confirm mount point
    • Name the share
    • Set valid users and permissions (read-only or writable)
    • Add fstab entry for auto-mount on boot
    • Mount the device
    • Auto-backup smb.conf before making any changes
    • Append the new share block
    • Restart smbd and nmbd
  • Backup smb.conf — one-key manual backup with timestamp
  • Samba Status — scrollable systemctl status smbd nmbd output
  • Edit smb.conf — opens in nano directly from the TUI
  • Restart Samba — with confirmation prompt
  • Supports ext4, NTFS, exFAT filesystems
  • Error checking at every step with clear messages

Requirements

  • Python 3.7+
  • Samba (smbd, nmbd)
  • ntfs-3g (for NTFS drives)
  • exfat-fuse (for exFAT drives)
  • lsblk, blkid (usually pre-installed)

Installation

git clone https://github.com/yourusername/samba-manager.git
cd samba-manager
sudo ./install.sh

Then run it anytime with:

sudo samba-manager

Manual (no install)

sudo python3 samba_manager.py

Usage

Navigate with arrow keys or j/k. Press the highlighted key for each action.

┌─────────────────────────────────────┐
│  ⚡ SAMBA MANAGER        MAIN MENU  │
│                                     │
│  [1] View Devices & UUID Table      │
│  [2] View Current Samba Shares      │
│  [3] Add New Samba Share (Wizard)   │
│  [4] Backup smb.conf                │
│  [5] Restart Samba Services         │
│  [6] Check Samba Status             │
│  [7] Edit smb.conf (nano)           │
│  [q] Quit                           │
└─────────────────────────────────────┘

Backups

Every time a share is added (or manually triggered), a timestamped backup of smb.conf is saved to:

~/.samba-manager/backups/smb.conf.YYYYMMDD_HHMMSS.bak

Filesystem Support

Filesystem fstab options used
ext4 defaults,nofail
ntfs/ntfs-3g defaults,uid=1000,gid=1000,umask=0022,nofail
exfat defaults,uid=1000,gid=1000,umask=0022,nofail
other defaults,nofail with auto type

Uninstall

sudo rm /usr/local/bin/samba-manager
sudo rm -rf /usr/local/lib/samba-manager

Backups in ~/.samba-manager/ are preserved.


License

MIT — see LICENSE

About

An interactive terminal UI (TUI) for managing Samba shares on Linux — built for Raspberry Pi but works on any Debian/Ubuntu system.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages