Edited text to align with other tutorials.

Added Prerequisites section.
Added sudo -s as first command and deleted sudo from other commands.
Edited text for active voice and consistency between steps.
Removed gerunds in headings.
Changed figure captions to remove gerunds and differentiate.

Signed-off-by: MCamp859 <mary.camp@ptiglobal.net>
This commit is contained in:
MCamp859
2018-03-29 11:48:39 -04:00
parent 314ac4215a
commit 6525cfe218
+84 -54
View File
@@ -1,31 +1,56 @@
.. _clear-samba-share-to-Windows:
Enabling simple file sharing from Clear Linux to a Windows machine using Samba
##############################################################################
Enable simple file sharing with a Windows\* machine using Samba\*
#################################################################
This guide covers the steps you need to enable simple file sharing
from |CLOSIA| to Windows. For more advanced sharing, please refer to the
`Samba guide`_.
This tutorial describes how to enable simple file sharing from a system
running |CLOSIA| to a Windows machine using Samba. For more advanced sharing,
refer to the `Samba guide`_.
#. Follow the :ref:`install-on-target` guide to install |CL|.
#. Add the storage-utils bundle, which includes the Samba binaries, after |CL|
is setup. The os-clr-on-clr bundle also includes the Samba binaries.
Prerequisites
*************
.. code-block:: console
This tutorial assumes you have installed |CL| on your host system. For
detailed instructions, follow the steps in :ref:`bare-metal-install`.
$sudo swupd bundle-add storage-utils
Before you install any new packages, update |CL| with the following command:
#. Create a configuration file at :file:`/etc/samba/smb.conf` and add the following
(change as needed). The following configuration has two simple examples.
The first example demonstrates sharing a folder to a specific user and
the second example demonstrates sharing a folder to anyone. The examples
assume that a user account named "clearlinuxuser" already exists.
If "valid users" is not specified as shown, then anyone with a user account
on this machine and with their Samba password already set can access the files.
However, that account is only able to access files and folders that the
account 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 that file.
.. code-block:: bash
sudo swupd update
Set up file sharing
*******************
#. Log in and get root privileges.
.. code-block:: bash
sudo -s
#. Add the storage-utils bundle, which includes the Samba binaries.
.. code-block:: bash
swupd bundle-add storage-utils
.. note::
The os-clr-on-clr bundle also includes the Samba binaries.
#. Create a configuration file called :file:`/etc/samba/smb.conf`. In this
example, `[Downloads]` enables a folder share with a specific user.
`[Documents]` enables a folder share with any user. The example assumes that a
user account `clearlinuxuser` already exists.
If `valid users` is not specified, then anyone with a user account on the
machine and with their Samba password already set can access the folder.
However, the account is only able to access files and folders for which
they have appropriate permissions.
Use :command:`chown` or :command:`chmod` to change either the owner of the
file or the permissions to allow other users to access the file.
.. code-block:: console
@@ -44,54 +69,59 @@ from |CLOSIA| to Windows. For more advanced sharing, please refer to the
browsable = yes
guest ok = yes
#. As root user, enable the Samba daemon so that it starts every time.
#. Enable the Samba daemon to start every time.
.. code-block:: console
.. code-block:: bash
# systemctl enable smb
# systemctl start smb
systemctl enable smb
systemctl start smb
#. Samba maintains its own list of passwords for user accounts. This list
of passwords can be different than the password used to log in. As root
user, use :command:`smbpasswd` to add the initial password needed by
the user account to access the share.
#. Use :command:`smbpasswd` to add the initial password for the user
account to access the share. Be aware that Samba maintains its own list of
passwords for user accounts. The Samba password list can be different than
the password used to log in.
.. code-block:: console
.. code-block:: bash
# smbpasswd -a clearlinuxuser
smbpasswd -a clearlinuxuser
#. At this point, a Windows machine on the same network can
access the shares. Windows uses the `\\\\[server IP or hostname]\\folder`
format to access shares. This access is done either directly using
Windows Explorer or by mapping the drive to a letter in Windows.
It is easiest to use the IP address of the machine to access it.
However, you can use the hostname of the |CL| machine as long as it is
behind an Active Directory domain controller or is 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`_.
Setup is complete and a Windows machine on the same network can access the
shares. Windows uses the format :file:`\\\\[server IP or hostname]\\folder` to
access shares. Access the shares directly with Windows Explorer or by
mapping a network drive.
Mapping |CL| drive in Windows
*****************************
Use the IP address of the |CL| machine for an easy access method. If the
|CL| machine is behind an Active Directory domain controller or a DNS server,
use the hostname of the |CL| machine. For other ways to access shares using a
hostname instead of an IP address, see `Chapter 7 of the Samba guide`_.
#. Open up Windows Explorer and click on the left sidebar on :guilabel:`This PC`
Map Clear Linux drive in Windows
********************************
#. Open 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.
#. Click the :guilabel:`Map Network Drive` icon and enter the path in the
format: :file:`\\\\[server IP or hostname]\\[shared folder]`
#. Check the box :guilabel:`Connect using different credentials`. Enter
the Samba user `clearlinuxuser` and the password created with
:command:`smbpasswd`. See Figure 1 for details.
.. figure:: figures/smb-1.png
:scale: 70%
:alt: Mapping a share in Windows Explorer
:alt: Map a network drive in Windows Explorer
Figure 1: Mapping a share in Windows Explorer
Figure 1: Map a network drive in Windows Explorer.
.. figure:: figures/smb-2.png
:scale: 70%
:alt: Mapping a share in Windows Explorer
When complete, Windows Explorer displays the share drive as shown in Figure 2.
Figure 2: Mapping a share in Windows Explorer
.. figure:: figures/smb-2.png
:scale: 70%
:alt: View a share drive in Windows Explorer
Figure 2: View a share drive in Windows Explorer.