Linux mount CIFS Windows Share

http‮ww//:s‬w.lautturi.com
Linux mount CIFS Windows Share

To mount a CIFS (Common Internet File System) Windows share in Linux, you will need to follow these steps:

  1. 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.

  2. 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
  1. Use the 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:

  • The device file for the CIFS share, which is //<server>/<share>. Replace <server> with the hostname or IP address of the server, and <share> with the name of the share.
  • The mount point that you created.
  • The username and password for the CIFS share.
  • Any additional mount options that you want to use.

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
Created Time:2017-10-30 10:17:41  Author:lautturi