Skip to content

Instantly share code, notes, and snippets.

@prateekrajgautam
Last active December 6, 2022 11:14
Show Gist options
  • Save prateekrajgautam/556adcf0ae802d5fbd3b435d9c399555 to your computer and use it in GitHub Desktop.
Save prateekrajgautam/556adcf0ae802d5fbd3b435d9c399555 to your computer and use it in GitHub Desktop.
Samba share on linux

CREATE FOLDER TO SHARE AND ADD PERMISSIONS

cd ~/Documents
mkdir sambaPublicShare
chmod 777 sambaPublicShare

INSTALL SAMBA

sudo apt-get install samba

sudo gedit /etc/samba/smb.conf

[global]
	server role = standalone server
	map to guest = Bad User
	usershare allow guests = yes
	host allow = 10.0.0.0/16
	host allow = 192.168.0.0/16
	host allow = 172.0.0.0/24
	host deny = 0.0.0.0/0
	
[publicshare]
	comment = test share
	path = /home/prateek/Documents/sambaPublicShare
	read only = no
	guest ok = yes
	force create mod = 0755
	force user = prateek
	force group = prateek


[drbl]
	comment = test share
	path = /home/prateek/Documents/sambadrbl
	read only = no
	guest ok = no
	force create mod = 0755
	force user = prateek
	force group = prateek

create samba network user

like

CREATE USERNAME for SAMBA LOGIN

sudo useradd -M -s /sbin/nologin USERNAME
sudo passwd USERNAME
sudo smbpasswd -a USERNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment