mirror of
https://github.com/clearlinux/clear-linux-documentation.git
synced 2026-08-26 02:05:48 +00:00
Add SMB file sharing tutorial.
Signed-off-by: Adams <eric.adams@intel.com>
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
@@ -0,0 +1,98 @@
|
||||
.. _clear-samba-share-to-Windows:
|
||||
|
||||
Enabling simple file sharing from Clear Linux to a Windows machine using Samba
|
||||
##############################################################################
|
||||
|
||||
This guide will cover the steps you need to do to enable simple file sharing
|
||||
from |CLOSIA| to Windows. For more advanced sharing please refer to the
|
||||
`Samba guide`_
|
||||
|
||||
#. Follow the :ref:`install-on-target` guide to install |CL|.
|
||||
#. After |CL| is setup then add the storage-utils bundle which
|
||||
includes the Samba binaries. The os-clr-on-clr bundle also includes this.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$sudo swupd bundle-add storage-utils
|
||||
|
||||
#. Create a configuration file at :file:`/etc/samba/smb.conf` and add the following
|
||||
but change as needed. The config below has two simple examples of sharing
|
||||
a folder to a specific user and sharing a folder to anyone. This
|
||||
method assumes that a user account named "clearlinuxuser" already exists.
|
||||
If a valid users is not specified below then anyone with a user account
|
||||
on this machine with their Samba password already set will be able to
|
||||
access the files. However, that account will only be able to access files
|
||||
and folders that it has permission to on the system. Use :command:`chown`
|
||||
or :command:`chmod` to change either the owner of the file or the
|
||||
permissions to allow other users to access.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
[Global]
|
||||
map to guest = bad user
|
||||
|
||||
[Downloads]
|
||||
path=/home/clearlinuxuser/Downloads
|
||||
read only = no
|
||||
guest ok = no
|
||||
valid users = clearlinuxuser
|
||||
|
||||
[Documents]
|
||||
path=/home/clearlinuxuser/Documents
|
||||
read only = no
|
||||
browsable = yes
|
||||
guest ok = yes
|
||||
|
||||
#. As root user, enable the Samba daemon so that it starts every time.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
# systemctl enable smb
|
||||
# systemctl start smb
|
||||
|
||||
#. Samba maintains its own list of passwords for user accounts and that can
|
||||
be different than the password to log in. As root user, use :command:`smbpasswd`
|
||||
to add the initial password for the user account that will access the share.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
# smbpasswd -a clearlinuxuser
|
||||
|
||||
#. At this point a Windows machine on the same network should be able to
|
||||
access the shares. Windows uses the format `\\\\[server IP or hostname]\\folder`
|
||||
to access shares. This can be done directly from Windows Explorer or the
|
||||
drive can be mapped to a letter in Windows. It is easiest to use the IP
|
||||
address of the machine to access it. However, using the hostname of the
|
||||
|CL| machine will work if it is behind an Active Directory domain
|
||||
controller or behind a DNS server. For other ways to access the shares
|
||||
using a hostname instead of an IP address consult `Chapter 7 of the Samba guide`_.
|
||||
|
||||
Mapping |CL| drive in Windows
|
||||
*****************************
|
||||
|
||||
#. Open up Windows Explorer and click on the left sidebar on :guilabel:`This PC`
|
||||
to change the options available at the top.
|
||||
#. Choose the :guilabel:`Map network drive` icon and put
|
||||
in the path as `\\\\[server IP or hostname]\\[shared folder]`.
|
||||
#. Check the box :guilabel:`Connect Using Different Credentials` to put in the Samba
|
||||
user defined above "clearlinuxuser" and the password created with
|
||||
:command:`smbpasswd`. See Figure 1 and Figure 2.
|
||||
|
||||
.. figure:: figures/smb-1.png
|
||||
:scale: 70%
|
||||
:alt: Mapping a share in Windows Explorer
|
||||
|
||||
Figure 1: Mapping a share in Windows Explorer
|
||||
|
||||
.. figure:: figures/smb-2.png
|
||||
:scale: 70%
|
||||
:alt: Mapping a share in Windows Explorer
|
||||
|
||||
Figure 2: Mapping a share in Windows Explorer
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.. _Samba guide: https://www.samba.org/samba/docs/using_samba/ch00.html
|
||||
.. _Chapter 7 of the Samba guide: https://www.samba.org/samba/docs/using_samba/ch07.html
|
||||
@@ -18,4 +18,4 @@ specific |CLOSIA| use cases.
|
||||
fmv
|
||||
aws-web/aws-web
|
||||
telemetry-backend/telemetry-backend
|
||||
|
||||
smb-file-sharing/smb-file-sharing
|
||||
|
||||
Reference in New Issue
Block a user