[LINUX] File sharing server made with Raspberry Pi that can be used for remote work

Introduction

This article describes how to build a file sharing server at home using Raspberry Pi.

Suppose your company distributes a Windows PC for remote work. Taking the designer as an example, if you want to copy the data on Windows distributed by your company to your Mac at home and work on it, you need some way to share files.

You can share files with online storage services such as Dropbox, but a convenient file sharing server is one that you can use at home.

By installing ** Samba ** on Raspberry Pi and building a file sharing server, you can easily share files on Windows and Mac.

Samba.png

SMB ** SMB (Server Message Block) ** is a protocol for sharing files and printers between Windows computers.

Use ** NetBIOS ** as the underlying protocol. There is also a protocol called ** CIFS ** that extends SMB. CIFS uses TCP / IP directly.

Building Samba

--Installing Samba $ sudo apt-get install samba samba-common-bin --Create a shared folder $ sudo mkdir /var/samba
--Creating a user to access a shared folder $ sudo useradd smbuser

Add the following to the /etc/samba/smb.conf file.

[share]
   comment = Share Folder
   browseable = yes
   path = /var/samba
   writable = yes
   valid users = smbuser
   force user = smbuser

--Restarting Samba $ sudo /etc/init.d/samba restart

pdbedit The pdbedit command manages the SAM database (the database for Samba users). It is used to manage the user accounts held in the SAM database and can only be run by root.

You can use pdbedit to add user accounts, delete user accounts, change user accounts, list user accounts, and import user accounts.

--List database user accounts $ sudo pdbedit -L

smbuser:1001:

--List database user accounts (details) $ sudo pdbedit -L -v

---------------
Unix username:        smbuser
NT username:          
Account Flags:        [U          ]
User SID:             S-1-5-21-1950213270-485466186-3954191822-1000
Primary Group SID:    S-1-5-21-1950213270-485466186-3954191822-513
Full Name:            
Home Directory:       \\raspberrypi01\smbuser
HomeDir Drive:        
Logon Script:         
Profile Path:         \\raspberrypi01\smbuser\profile
Domain:               RASPBERRYPI01
Account desc:         
Workstations:         
Munged dial:          
Logon time:           0
Logoff time:          never
Kickoff time:         never
Password last set:water,25 March 2020 15:11:40 JST
Password can change:water,25 March 2020 15:11:40 JST
Password must change: never
Last bad password   : 0
Bad password count  : 0
Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

File sharing server access

If the firewall is enabled on the Raspberry Pi side, it is assumed that the communication used by Samba is permitted, and the access methods for Windows and Mac are described.

Windows To access Samba on Windows 10, you need an SMB client. For Windows 10, SMB 1.0 is disabled, so follow the steps below to enable the SMB client.

  1. Open the control panel
  2. From the program, open [Turn Windows features on or off]
  3. Check [SMB 1.0 / CIFS Client] and click [OK].
  4. After activating the SMB client, access \\ <Raspberry Pi IP address>: \ share \ on the network from Explorer.
  5. You can access the file sharing server by entering the smbuser credentials you created earlier.

Mac For Mac, access from Finder.

  1. Select [Connect to Server] from [Go] in Finder.
  2. Enter smb: // <Raspberry Pi IP address> in [Server Address] and click [Connect].
  3. Select the registered user and enter the smbuser authentication information created earlier to access the file sharing server.

in conclusion

Make effective use of Raspberry Pi and use it for remote work.

Recommended Posts

File sharing server made with Raspberry Pi that can be used for remote work
File types that can be used with Go
Mathematical optimization that can be used for free work with Python + PuLP
SSD 1306 OLED can be used with Raspberry Pi + python (Note)
Functions that can be used in for statements
I made a familiar function that can be used in statistics with Python
I made a resource monitor for Raspberry Pi with a spreadsheet
I made a web server with Raspberry Pi to watch anime
Understand the probabilities and statistics that can be used for progress management with a python program
I made a shuffle that can be reset (reverted) with Python
About the matter that the re.compiled object can be used for the re.match pattern
I created a template for a Python project that can be used universally
Acoustic signal processing module that can be used with Python-Sounddevice ASIO [Application]
[Electronic work] I made a Suica touch sound detector with Raspberry Pi
Acoustic signal processing module that can be used with Python-Sounddevice ASIO [Basic]
Try fishing for smelt with Raspberry Pi
Improved motion sensor made with Raspberry Pi
A memo for making a figure that can be posted to a journal with matplotlib
[For beginners] I made a motion sensor with Raspberry Pi and notified LINE!
[Hackathon] About making a tool that can be CD on Raspberry Pi [Convenient tool]
I made a Python program for Raspberry Pi that operates Omron's environmental sensor in the mode with data storage
Media programming with Raspberry Pi (preparation for audio)
Enjoy electronic work with GPIO on Raspberry Pi
Stock investment analysis app made with Raspberry Pi
Overview and useful features of scikit-learn that can also be used for deep learning
Convert images from FlyCapture SDK to a form that can be used with openCV
Build a server on Linux and local network with Raspberry Pi NextCloud and desktop sharing
[Python] Introduction to web scraping | Summary of methods that can be used with webdriver
The story that sendmail that can be executed in the terminal did not work with cron
I made a tool to automatically generate a state transition diagram that can be used for both web development and application development
Basic algorithms that can be used in competition pros
Japanese can be used with Python in Docker environment
Color list that can be set with tkinter (memorial)
ANTs image registration that can be used in 5 minutes
[Django] About users that can be used on template
Limits that can be analyzed at once with MeCab
[Raspberry Pi] Scraping of web pages that cannot be obtained with python requests + Beautiful Soup
Can be used with AtCoder! A collection of techniques for drawing short code in Python!
It was great to edit the Python file in the Raspberry Pi with Atom's remote function
I made a data extension class for tensorflow> = 2.0 because ImageDataGenerator can no longer be used.
How to set variables that can be used throughout the Django app-useful for templates, etc.-