Reorder and clarify Samba setup instructions across recipes. Remove redundant "Configure Samba" section from install. Consolidate "Create Samba User" in install recipe. Relocate service verification to post-restart in configure recipe. Correct 'smbd --version' command.
1.0 KiB
1.0 KiB
Install Samba
This recipe installs Samba on Ubuntu, enables the required services, and configures a basic file share.
Install Packages
sudo apt update
sudo apt install -y samba
Verify Installation
sudo smbd --version
Expected output:
Version 4.x.x
Enable Services
sudo systemctl enable smbd
sudo systemctl enable nmbd
sudo systemctl start smbd
sudo systemctl start nmbd
Verify Services
systemctl status smbd --no-pager
systemctl status nmbd --no-pager
Both services should be reported as active (running).
Restart Samba
sudo systemctl restart smbd
sudo systemctl restart nmbd
Configure Firewall (Optional)
If UFW is enabled:
sudo ufw allow samba
Verify Listening Ports
sudo ss -tulpn | grep smb
Expected output should include ports 139 and 445.
Create Samba User
sudo smbpasswd -a <username>
sudo smbpasswd -e <username>
List configured Samba users.
sudo pdbedit -L