A Cockpit plugin for managing Samba and NFS shares.
/etc/samba/smb.conf
) User and group management was removed from cockpit-file-sharing in favour of managing Samba users through the new cockpit-identities plugin. Install that plugin to manage groups and Samba passwords.
/etc/exports
)Recommended: cockpit-identities for managing Samba password.
curl -sSL https://repo.45drives.com/setup | sudo bash
sudo apt-get update
sudo apt install cockpit-file-sharing
Installing this way may work for other versions of Ubuntu and Debian, but it is unsupported. You won't get automatic updates this way.
curl -LO https://github.com/45Drives/cockpit-file-sharing/releases/download/v4.2.6/cockpit-file-sharing_4.2.6-1focal_all.deb
sudo apt install ./cockpit-file-sharing_4.2.6-1focal_all.deb
curl -sSL https://repo.45drives.com/setup | sudo bash
sudo dnf install cockpit-file-sharing
Installing this way may work for other versions of Rocky/Centos/RHEL/Fedora/etc, but it is unsupported. You won't get automatic updates this way.
# dnf or yum
sudo dnf install https://github.com/45Drives/cockpit-file-sharing/releases/download/v4.2.6/cockpit-file-sharing-4.2.6-1.el8.noarch.rpm
# debian-like
cockpit-bridge
coreutils
attr
findutils
hostname
iproute2
libc-bin
systemd
nfs-kernel-server
samba-common-bin
# RHEL-like
cockpit-bridge
coreutils
attr
findutils
hostname
iproute
glibc-common
systemd
nfs-utils
samba-common-tools
curl -LO https://github.com/45Drives/cockpit-file-sharing/releases/download/v4.2.6/cockpit-file-sharing_4.2.6_generic.zip
unzip cockpit-file-sharing_4.2.6_generic.zip
cd cockpit-file-sharing_4.2.6_generic
# no need to run `make` first, the plugin is pre-built
sudo make install
The Samba tab in cockpit-file-sharing is a front end UI for the net conf registry used by Samba. Any shares manually configured in /etc/samba/smb.conf
won't show up in the UI, but they can be imported with the Import
button at the bottom of the page. Your Samba configuration file must have include = registry
in the [global]
section, which can be automatically configured in one click in the UI.
Simply click the +
in the top right of the shares list, fill out the required fields, and click Confirm
.
guest account
(default=nobody
)map acl inherit = yes
acl_xattr:ignore system acls = yes
vfs objects = acl_xattr
vfs objects = shadow_copy2
shadow:snapdir = .zfs/snapshot
shadow:sort = desc
shadow:format = %Y-%m-%d-%H%M%S
vfs objects = ceph_snapshots
vfs objects = catia fruit streams_xattr
fruit:encoding = native
fruit:metadata = stream
fruit:zero_file_id = yes
fruit:nfs_aces = no
vfs objects = full_audit
full_audit:priority = notice
full_audit:facility = local5
full_audit:success = connect disconnect mkdir rmdir read write rename
full_audit:failure = connect
full_audit:prefix = %u|%I|%S
Click the pencil icon at the right side of the share list entry to edit the share. Settings are the same as creating a share, except you cannot change the share name or path.
Click the trash can icon at the right side of the share list entry, then click Yes
in the confirmation prompt to delete the share. This only removes the share definition from Samba, it does not remove any files.
User and group management was removed from cockpit-file-sharing, in favour of implementing it in a separate plugin, cockpit-identities
This section was removed from cockpit-file-sharing.
/etc/samba/smb.conf
To allow cockpit-file-sharing to manage existing shares defined in /etc/samba/smb.conf
, click the Import configuration from /etc/samba/smb.conf
button at the bottom of the page.
It will confirm before overwriting your current share settings, and prompt to replace the content of /etc/samba/smb.conf
with only include = registry
in the [global]
section,
backing up the original content to /etc/samba/smb.conf.bak.~1~
.
The NFS tab in cockpit-file-sharing is a graphical way of editing the contents of /etc/exports.d/cockpit-file-sharing.exports
, which has the same syntax as /etc/exports
.
Much like the Samba tab, simply click the +
in the top right of the shares list to start adding an NFS export. The only settings are the path to the directory you want to share, and a list of clients consiting of a host and a comma-separated list of export options for that host. See exports(5) for options and machine name formats for the host field.
Click the pencil icon at the right side of the share list entry to edit the share. Settings are the same as creating a share.
Click the trash can icon at the right side of the share list entry, then click Yes
in the confirmation prompt to delete the share. This only removes the share definition from Samba, it does not remove any files.
/etc/exports
To allow cockpit-file-sharing to manage existing shares defined in /etc/exports
, do the following (as root):
cp /etc/exports /etc/exports.bak
mv /etc/exports /etc/exports.d/cockpit-file-sharing.exports
touch /etc/exports