Skip to content

Instantly share code, notes, and snippets.

@DmitryKorlas
Created April 16, 2015 21:09
Show Gist options
  • Select an option

  • Save DmitryKorlas/5effff983161a96a551e to your computer and use it in GitHub Desktop.

Select an option

Save DmitryKorlas/5effff983161a96a551e to your computer and use it in GitHub Desktop.

Share unix folder into the win network

Firstly you have to install samba

sudo apt-get install samba

Then you have to configure samba config and add network folders

0. Share folder from Your home dir

add this section into /etc/samba/smb.conf

[Public]
   path = /home/dk/Public
   browseable = yes
   read only = no
   guest ok = yes
   force user=dk
   force group=dk

1. Share folder out of home directory

sudo mkdir /opt/netshare sudo chown dk:dk netshare

add this section into /etc/samba/smb.conf

[netshare]
   path = /opt/netshare
   read only = yes
   guest ok = yes
   force user=dk
   force group=dk

2. Share folder from the special user

sudo useradd -m sambauser -p qwerty123
sudo usermod -a -G sambashare sambauser # add user sambauser to group sambashare
sudo mkdir /opt/netshare2

sudo chown sambauser:sambashare /opt/netshare2
sudo chmod ugo+rwx /opt/netshare2

add into /etc/samba/smb.conf

[netshare2]
   path = /opt/netshare2
   read only = yes
   guest ok = yes
   force user=sambauser
   force group=sambashare
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment