Created
November 1, 2019 18:03
-
-
Save zicodhkbd/ba5eadbda8101ea8018efddd7c7c46c0 to your computer and use it in GitHub Desktop.
Samba Server(SMB/CIFS) on Ubuntu 18.04 LTS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo apt update | |
sudo apt install samba | |
sudo systemctl status nmbd | |
sudo ufw allow 'Samba' | |
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.backup | |
sudo nano /etc/samba/smb.conf | |
server role = standalone server | |
interfaces = 127.0.0.0/8 eth0 | |
bind interfaces only = yes | |
sudo systemctl restart nmbd | |
sudo mkdir /samba | |
sudo chgrp sambashare /samba | |
sudo useradd -M -d /samba/jack -s /usr/sbin/nologin -G sambashare jack | |
sudo mkdir /samba/jack | |
sudo chown jack:sambashare /samba/jack | |
sudo chmod 2770 /samba/jack | |
sudo smbpasswd -a jack | |
sudo smbpasswd -e jack | |
sudo nano /etc/samba/smb.conf | |
[samba-share] | |
comment = Samba on Ubuntu | |
path = /samba/jack | |
browseable = yes | |
read only = no | |
force create mode = 0660 | |
force directory mode = 2770 | |
valid users = jack @sambashare | |
sudo systemctl restart nmbd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment