Skip to content
How to share files on Linux® with MyCrypNet

This tutorial is for people who want to share their files from Linux® over a MyCrypNet network.

How to share files on Linux® with MyCrypNet

It is based on Samba (SMB).

If you want more general informations on how does a file sharing works or how to install it on other operating systems, check this article.

You need to have a MyCrypNet network set up. Check this help page in order to create one.

Step 1/5: Create a user (Linux® user)

To manage files sharing on your MyCrypNet private network you may choose either to give user names to your devices or to your network fellows (sometimes a network fellow has several different devices). You also may choose both. But you sometimes have different user accounts on a same device. So beware of your choice.

If you want to create a specific user name to access your shared folders, you can type this command on a terminal (the naming convention in uppercase is explained here):

sudo useradd ALICE --shell /bin/false

You can create as many users as you wish to differentiate people accessing your Samba share.

Create a group (Linux® group)

You may need a specific group for your Samba share. It avoids that users accessing your Samba share acquire permissions for other elements of your server.

You can type this command on a terminal (the naming convention in uppercase is explained here):

sudo groupadd USERS-GROUP

Now, add your users to this group:

sudo usermod -a -G USERS-GROUP ALICE

Step 2/5: Install Samba

On “Debian like”:

sudo apt install samba

On “Centos like”:

yum install samba

Step 3/5: Create the shared folder

In order to share files, create a shared folder (the naming convention in uppercase is explained here):

sudo mkdir FOLDER-PATH

Give permissions for the user(s) you want to authorize access to this folder:

sudo chown -R ALICE:USERS-GROUP FOLDER-PATH

Step 4/5: Configure the folder to share

Add a specific password for the user with Samba (the naming convention in uppercase is explained here):

sudo smbpasswd -a ALICE

The identifiers of this new user account have to be communicated to the person who will, later on, access the shared folders. Always favor a secure communication method (encrypted message, etc.).

Edit the file smb.conf:

sudo nano /etc/samba/smb.conf

Add the folder, the group and the user(s) to the configuration:


[SHARE-NAME]
path = FOLDER-PATH
valid users = ALICE,BOB
force group = USERS-GROUP
read only = no
browsable = yes

Of course, if you want to share the folder with read only rights, you write “read only = yes”.

If you want to make this share discoverable by users once they add their username and password, use “browsable = yes”. Otherwise, users need to know the share name in order to accede to it.

Step 5/5: Begin to share

Restart the Samba service:

sudo systemctl restart smbd.service

Test the share:

testparm

Create your secure network

Follow us
© 2018 Coppint Market Place Ltd, All rights reserved.