To mount a CIFS (Common Internet File System) Windows share in Linux, you will need to follow these steps:
Install the cifs-utils
package, which provides the utilities needed to mount CIFS filesystems. You can install the cifs-utils
package using your system's package manager, such as apt
or yum
.
Create a mount point for the CIFS share. A mount point is a directory where the CIFS share will be mounted. For example, you can create a mount point at /mnt/cifs_share
:
$ mkdir -p /mnt/cifs_share
mount
command to mount the CIFS share at the mount point. The mount
command requires the -t cifs
option to specify that the filesystem type is CIFS, and the -o
option to specify mount options.To mount the CIFS share, you will need to provide the following information:
//<server>/<share>
. Replace <server>
with the hostname or IP address of the server, and <share>
with the name of the share.For example, to mount a CIFS share called sales
on a server with the hostname WIN_SHARE_IP
:
sudo mount -t cifs -o username=<win_share_user> //WIN_SHARE_IP/<sales> /mnt/win_share
The password can also be provided on the command line:
sudo mount -t cifs -o username=<win_share_user>,password=<win_share_password> //WIN_SHARE_IP/<share_name> /mnt/win_share
If the user is in windows workgroup or domain you can set it as follows:
sudo mount -t cifs -o username=<win_share_user>,domain=<win_domain> //WIN_SHARE_IP/<share_name> /mnt/win_share