A video demonstration of how to set up a Samba file sharing server in Linux Mint 19 and share folders and files over the network to a Windows 10 client.
Instructions:
Make sure Mint is on your local network. You may need to change your virtual network adapter settings in Virtualbox or Vmware to Bridged Adapter or Bridged mode. If necessary click on your Mint wired network connection in the lower right corner of the Mint desktop to disable/re-enable it.
In Windows 10:
Start / Control Panel / Network and Sharing Center / Change advanced sharing settings / and in your current profile make sure Turn on network discovery and Turn on file and printer sharing are both "On"
Start / Control Panel / Programs and Features / and click on Turn Windows features on or off, then in the window scroll down and checkmark SMB Direct
In Linux Mint:
either turn off the UFW firewall ($ sudo service ufw stop) or add a SAMBA firewall rule to allow tcp 139, 445 and udp 137, 138 using GUFW ($ sudo gufw)
$ sudo ifconfig # do you have an ip address on your home network?
$ ping yahoo.com # ctrl+c to quit
//Update your software packages and install samba
$ sudo apt-get update
$ sudo apt install samba samba-common-bin
//Add your Linux Mint user account, name and password to the smbpasswd file for Samba users
$ sudo smbpasswd -a dan
//Backup the samba configuration file
$ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
//Edit the samba configuration to add the shared folder configurations
$ sudo nano /etc/samba/smb.conf
# at the very end of the smb.conf file add the following lines
[share]
comment = my shared folder
path = /srv/samba/share
browseable = yes
guest ok = yes
read only = no
create mask = 0755
#force user = dan
[share2]
path = /home/dan/samba
available = yes
valid users = dan
read only = no
browseable = yes
public = yes
writable = yes
//After testing and verifying the shared folders are working at the bottom of this lab you can remove the comment (#) at the beginning of the "force user" line and then add a comment (#) to the "guest ok" line to add security with an authentication password prompt when accessing the shared folder.
//Now create the actual folders you intend to share, change the owner and group, add a text file to the folders, and add some text to the files
$ sudo mkdir -p /srv/samba/share
$ sudo chown nobody:nogroup /srv/samba/share/
$ sudo touch /srv/samba/share/hello.txt
$ sudo chown dan:dan /srv/samba/share/hello.txt
$ sudo echo "this is some text" (greater-than sign) /srv/samba/share/hello.txt
$ mkdir ~/samba
$ touch ~/samba/text.txt
$ echo "hello" (greater-than sign) ~/samba/text.txt
//Now restart samba (Server Message Block daemon) and nmbd (NetBIOS name server)
$ sudo service smbd restart
$ sudo service nmbd restart
- Open a folder in Windows and in the address bar put in the ip address of Mint prefaced with 2 backslashes like this: \\192.168.8.51 and press enter and you should see your shared folder. See if you can change the text file and save it or if you can create a new file.
Turning it in:
Create a word processing document that describes the process and proves you did the lab with screenshots.
Ещё видео!