A Microsoft Windows file share is a specific folder in your file system. It includes that folder's subfolders, which you make accessible to your compute instances with the Server Message Block (SMB) protocol. Your file system comes with a default Windows file share, named
$ net use H: \\amzfsxaa11bb22.ad-domain.com\share /persistent:yes2. You can create and manage as many other Windows file shares as you want by using the Windows graphical user interface (GUI) tool named Shared Folders.Nội dung chính Show
- Automatically mounting file shares on an Amazon Linux EC2 instance not joined to your Active Directory
- Which protocol does Windows use by default for file sharing quizlet?
- Which of the following is the native Linux UNIX file sharing protocol?
- Which protocol does Linux use to share files with Microsoft Windows operating systems?
- What file can you edit on a Linux system to configure shared folder using Samba?
To access your file shares, you use the Windows Map Network Drive functionality to map a drive letter on your compute instance to your Amazon FSx file share. The process of mapping a file share to a drive on your compute instance is known as mounting a file share in Linux. This process differs depending on the type of compute instance and the operating system. After your file share is mapped, your applications and users can access files and folders on your file share as if they are local files and folders.
Following are procedures for mapping a file share on the different supported compute instances.
You can map a file share on an EC2 Windows instance by using the Windows File Explorer or the command prompt.
Launch the EC2 Windows instance and connect it to the Microsoft Active Directory that you joined your Amazon FSx file system to. To do this, choose one of the following procedures from the AWS Directory Service Administration Guide:
Connect to your EC2 Windows instance as a user in your AWS Managed Microsoft AD directory. For more information, see Connecting to your Windows instance in the Amazon EC2 User Guide for Windows Instances.
After you're connected, open a command prompt window.
Mount the file share using a drive letter of your choice, the file system's DNS name, and the share name. You can find the DNS name using the Amazon FSx consoleby choosing Windows File Server, Network & security. Or, you can find them in the response of the
$ net use H: \\amzfsxaa11bb22.ad-domain.com\share /persistent:yes3 or $ net use H: \\amzfsxaa11bb22.ad-domain.com\share /persistent:yes4 API operation.For a Single-AZ file system joined to an AWS Managed Microsoft Active Directory, the DNS name looks like the following.
fs-0123456789abcdef0.ad-domain.comFor a Single-AZ file system joined to a self-managed Active Directory, and any Multi-AZ file system, the DNS name looks like the following.
amznfsxaa11bb22.ad-domain.com
The following is an example command to mount the file share.
$ net use H: \\amzfsxaa11bb22.ad-domain.com\share /persistent:yesInstead of the
$ net use H: \\amzfsxaa11bb22.ad-domain.com\share /persistent:yes5 command, you can also use any supported PowerShell command to mount a file share.
You can mount a file share on an Amazon EC2 Mac instance that is either joined to your Active Directory or not joined. If the instance is not joined to your Active Directory, be sure to update the DHCP options set for the Amazon Virtual Private Cloud (Amazon VPC) in which the instance resides to include the DNS name servers for your Active Directory domain. Then relaunch the instance.
Launch the EC2 Mac instance. To do this, choose one of the following procedures from the Amazon EC2 User Guide for Linux Instances:
Connect to your EC2 Mac instance using Virtual Network Computing (VNC). For more information, see Connect to your instance using VNC in the Amazon EC2 User Guide for Linux Instances.
Mount the file share with the following command.
mount_smbfs //file_system_dns_name/file_share mount_pointYou can find the DNS name on the Amazon FSx consoleby choosing Windows File Server, Network & security. Or, you can find them in the response of the
$ net use H: \\amzfsxaa11bb22.ad-domain.com\share /persistent:yes3 or $ net use H: \\amzfsxaa11bb22.ad-domain.com\share /persistent:yes4 API operation.For a Single-AZ file system joined to an AWS Managed Microsoft Active Directory, the DNS name looks like the following.
fs-0123456789abcdef0.ad-domain.comFor a Single-AZ file system joined to a self-managed Active Directory, and any Multi-AZ file system, the DNS name looks like the following.
amznfsxaa11bb22.ad-domain.com
The mount command used in this procedure does the following at the given points:
- $ net use H: \\amzfsxaa11bb22.ad-domain.com\share /persistent:yes8/$ net use H: \\amzfsxaa11bb22.ad-domain.com\share /persistent:yes9 – Specifies the DNS name and share of the file system to mount.
- mount_smbfs //file_system_dns_name/file_share mount_point0 – The directory on the EC2 instance that you are mounting the file system to.
You can mount an FSx for Windows File Server file share on an Amazon EC2 Linux instance that is either joined to your Active Directory or not joined.
The following commands specify parameters such as SMB protocol, caching, and read and write buffer size as examples only. Parameter choices for the Linux
mount_smbfs //file_system_dns_name/file_share mount_point1 command, as well as the Linux kernel version used, can impact throughput and latency for network operations between the client and the Amazon FSx file system. For more information, see mount_smbfs //file_system_dns_name/file_share mount_point1 documentation for the Linux environment you are using.The following procedure mounts an Amazon FSx file share to an Amazon EC2 Linux instance that is not joined to your Active Directory (AD). For an EC2 Linux instance that is not joined to your Active Directory, you can only mount an FSx for Windows File Server file share by using its private IP address. You can get the file system's private IP address using the Amazon FSx console, on the Network & security tab, in Preferred File Server IP Address.
This example uses NTLM authentication. To do this, you mount the file system as a user that is a member of the Microsoft Active Directory domain that the FSx for Windows File Server file system is joined to. The credentials for the user account are provided in a text file that you create on your EC2 instance,
mount_smbfs //file_system_dns_name/file_share mount_point3. This file contains the user name, password, and domain for the user.$ cat creds.txt username=user1 password=Password123 domain=EXAMPLE.COMTo launch and configure the Amazon Linux EC2 instance
Launch an Amazon Linux EC2 instance using the Amazon EC2 console. For more information, see Launch an instance in the Amazon EC2 User Guide for Linux Instances.
Connect to your Amazon Linux EC2 instance. For more information, see Connect to your Linux instance in the Amazon EC2 User Guide for Linux Instances.
Run the following command to install the
mount_smbfs //file_system_dns_name/file_share mount_point4 package. This package is used to mount network file systems like Amazon FSx on Linux.$ sudo yum install cifs-utilsCreate the mount point
mount_smbfs //file_system_dns_name/file_share mount_point5 where you plan to mount the Amazon FSx file system.$ sudo mkdir -p /mnt/fsxCreate the
Set the
mount_smbfs //file_system_dns_name/file_share mount_point3 file permissions so that only you (the owner) can read and write to the file by running the following command.$ chmod 700 creds.txt
To mount the file system
You mount a file share not joined to your Active Directory by using its private IP address. You can get the file system's private IP address using the Amazon FSx console, on the Network & security tab, in the Preferred File Server IP Address.
Mount the file system using the following command:
amznfsxaa11bb22.ad-domain.com0Replace
mount_smbfs //file_system_dns_name/file_share mount_point9 with the largest value allowed by your kernel. Run the following command to get this value.amznfsxaa11bb22.ad-domain.com1The output shows that the maximum buffer size is 130048.
Verify that the file system is mounted by running the following command, which returns only CIFS file systems.
amznfsxaa11bb22.ad-domain.com2
The mount command used in this procedure does the following at the given points:
- fs-0123456789abcdef0.ad-domain.com0/$ net use H: \\amzfsxaa11bb22.ad-domain.com\share /persistent:yes9 – Specifies the IP address and share of the file system to mount.
- fs-0123456789abcdef0.ad-domain.com2 – Specifies the type of file system as CIFS and the SMB protocol version. Amazon FSx for Windows File Server supports SMB versions 2.0 through 3.1.1.
- fs-0123456789abcdef0.ad-domain.com3 – Specifies to use NT LAN Manager Security Support Provider Interface (NTLMSSPI) for authentication.
- fs-0123456789abcdef0.ad-domain.com4 – Sets the cache mode. This option for CIFS cache can impact performance, and you should test which settings work best (and review Linux documentation) for your kernel and workload. Options fs-0123456789abcdef0.ad-domain.com5 and fs-0123456789abcdef0.ad-domain.com6 are recommended, because fs-0123456789abcdef0.ad-domain.com7 can cause data inconsistency due to the looser protocol semantics.
- fs-0123456789abcdef0.ad-domain.com8 – Specifies where to get the user credentials.
- fs-0123456789abcdef0.ad-domain.com9 – Specifies the mount point for the Amazon FSx file share on your EC2 instance.
- amznfsxaa11bb22.ad-domain.com0,wsize=amznfsxaa11bb22.ad-domain.com1 – Specifies the read and write buffer size as the maximum allowed by the CIFS protocol. Replace mount_smbfs //file_system_dns_name/file_share mount_point9 with the largest value allowed by your kernel. Determine the amznfsxaa11bb22.ad-domain.com1 by running the following command.amznfsxaa11bb22.ad-domain.com1
The output shows that the maximum buffer size is 130048.
Automatically mounting file shares on an Amazon Linux EC2 instance not joined to your Active Directory
You can automatically mount your FSx for Windows File Server file share whenever the Amazon EC2 Linux instance to which it's mounted reboots. To do so, add an entry to the
amznfsxaa11bb22.ad-domain.com4 file on the EC2 instance. The amznfsxaa11bb22.ad-domain.com4 file contains information about file systems. The command mount -a, which runs during instance startup, mounts the file systems listed in the amznfsxaa11bb22.ad-domain.com4 file.For an Amazon Linux EC2 instance that is not joined to your Active Directory, you can only mount an FSx for Windows File Server file share by using its private IP address. You can get the file system's private IP address using the Amazon FSx console, on the Network & security tab, in Preferred File Server IP Address.
The following procedure uses Microsoft NTLM authentication. You mount the file system as a user that is a member of the Microsoft Active Directory domain to which the FSx for Windows File Server file system is joined. The credentials for the user account are provided in the text file
mount_smbfs //file_system_dns_name/file_share mount_point3. This file contains the user name, password, and domain for the user.$ cat creds.txt username=user1 password=Password123 domain=EXAMPLE.COMTo launch and configure the Amazon Linux EC2 instance
Launch an Amazon Linux EC2 instance using the Amazon EC2 console. For more information, see Launch an instance in the Amazon EC2 User Guide for Linux Instances.
Connect to your instance. For more information, see Connect to your Linux instance in the Amazon EC2 User Guide for Linux Instances.
Run the following command to install the
Create the
amznfsxaa11bb22.ad-domain.com9 directory. This is where you will mount the Amazon FSx file system.amznfsxaa11bb22.ad-domain.com6Create the
mount_smbfs //file_system_dns_name/file_share mount_point3 credentials file in the mount_smbfs //file_system_dns_name/file_share mount_point7 directory.Set the file permissions so that only you (the owner) can read the file by running the following command.
amznfsxaa11bb22.ad-domain.com7
To automatically mount the file system
You automatically mount a file share not joined to your Active Directory by using its private IP address. You can get the file system's private IP address from the Amazon FSx console, in the Network & security tab, the Preferred File Server IP Address.
To automatically mount the file share using its private IP address, add the following line to the
amznfsxaa11bb22.ad-domain.com4 file.amznfsxaa11bb22.ad-domain.com 8Replace
mount_smbfs //file_system_dns_name/file_share mount_point9 with the largest value allowed by your kernel. Run the following command to get this value.amznfsxaa11bb22.ad-domain.com1The output shows that the maximum buffer size is 130048.
Test the
$ cat creds.txt username=user1 password=Password123 domain=EXAMPLE.COM4 entry by using the $ cat creds.txt username=user1 password=Password123 domain=EXAMPLE.COM5 command with the 'fake' option in conjunction with the 'all' and 'verbose' options.$ net use H: \\amzfsxaa11bb22.ad-domain.com\share /persistent:yes0To mount the file share, reboot the Amazon EC2 instance.
When the instance is available again, verify that the file system is mounted by running the following command.
$ net use H: \\amzfsxaa11bb22.ad-domain.com\share /persistent:yes1The line added to the
amznfsxaa11bb22.ad-domain.com4 file in this procedure does the following at the given points:- fs-0123456789abcdef0.ad-domain.com0/$ net use H: \\amzfsxaa11bb22.ad-domain.com\share /persistent:yes9 – Specifies the IP address and share of the Amazon FSx file system you're mounting.
- amznfsxaa11bb22.ad-domain.com9 – Specifies the mount point for the Amazon FSx file system on your EC2 instance.
- $ sudo yum install cifs-utils0 – Specifies the type of file system as CIFS and the SMB protocol version. Amazon FSx for Windows File Server supports SMB versions 2.0 through 3.1.1.
- fs-0123456789abcdef0.ad-domain.com3 – Specifies using NT LAN Manager Security Support Provider Interface to facilitate NTLM challenge-response authentication.
- fs-0123456789abcdef0.ad-domain.com4 – Sets the cache mode. This option for CIFS cache can impact performance, and you should test which settings work best (and review Linux documentation) for your kernel and workload. Options fs-0123456789abcdef0.ad-domain.com5 and fs-0123456789abcdef0.ad-domain.com6 are recommended, because fs-0123456789abcdef0.ad-domain.com7 can cause data inconsistency due to the looser protocol semantics.
- fs-0123456789abcdef0.ad-domain.com8 – Specifies where to get the user credentials.
- $ sudo yum install cifs-utils7 – Tells the operating system that the file system resides on a device that requires network access. Using this option prevents the instance from mounting the file system until the network service is enabled on the client.
- $ sudo yum install cifs-utils8 – Indicates that the file system should be backed up by $ sudo yum install cifs-utils9, if it's a nonzero value. For Amazon FSx, this value should be $ sudo yum install cifs-utils8.
- $ sudo yum install cifs-utils8 – Specifies the order in
which $ sudo mkdir -p /mnt/fsx2 checks file systems at boot. For Amazon FSx file systems, this value should be $ sudo yum install cifs-utils8 to indicate that $ sudo mkdir -p /mnt/fsx2 shouldn't run at startup.
Which protocol does Windows use by default for file sharing quizlet?
Server Message Blocks (SMB) is the standard file-sharing protocol used by all versions of Windows. Network File System (NFS) is the standard file-sharing protocol used by most UNIX and Linux distributions.
Which of the following is the native Linux UNIX file sharing protocol?
NFS is that native Linux/UNIX file sharing protocol and is supported by Windows and Mac OS X.
More Linux resources Samba uses the Server Message Block (SMB) protocol, which is used by Windows systems to communicate with each other.
What file can you edit on a Linux system to configure shared folder using Samba?
To configure shares and users, edit the /etc/samba/smb. conf file. The default file has several good examples of common options, including provisions for shared printers and home directories. There's a global section, which defines a workgroup.