Difference between revisions of "Windows Network Share"

From ArchWiki
Jump to navigation Jump to search
m (Allowing users to mount: mv notes after content)
m (Autofs: rm repeated ln)
Line 54: Line 54:
[[Autofs]] is a kernel-based automounter for Linux. See the [[Autofs]] wiki article for details.
Autofs is a kernel-based automounter for Linux. See: [[Autofs]] for details.
==Manual share mounting==
==Manual share mounting==

Revision as of 14:55, 1 January 2010

Template:Article summary start Template:Article summary text Template:Article summary heading Template:I18n entry Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary end


Install the Template:Package Official package with pacman:

# pacman -S smbclient

Automatic share mounting

There are several alternatives for easy share browsing.


1. Install Template:Package Official:

# pacman -S smbnetfs

2. Add the following line to Template:Filename:


3. Load the Template:Codeline kernel module:

# modprobe fuse

4. Start the Template:Codeline daemon:

# /etc/rc.d/smbnetfs start

All shares in the network are now automatically mounted under Template:Filename.

Add the following to Template:Filename to access the shares at boot:

MODULES=(... fuse ...)
DAEMONS=(... smbnetfs ...)


Note: Because Template:Codeline is malfunctioning with Template:Codeline, revert to using older versions if necessary. See the relevant forum topic for details.

1. Install the Template:Package AUR package from the AUR using yaourt or other AUR Helpers:

$ yaourt -S fusesmb

2. Create a mount point:

# mkdir /mnt/fusesmb

3. Load Template:Codeline module:

# modprobe fuse

4. Mount the shares:

# fusesmb -o allow_other /mnt/fusesmb

For mounting shares at boot, add the command above to Template:Filename and add Template:Codeline module to Template:Filename:

MODULES=(... fuse ...)


Autofs is a kernel-based automounter for Linux. See: Autofs for details.

Manual share mounting

1. Create the mount point for the share:

# mkdir /mnt/MOUNTPOINT

2. Mount the share using Template:Codeline. Keep in mind that not all options may be needed nor desirable, such as Template:Codeline:

The Windows system's name
The shared directory
The local directory where the share will be mounted to
Specifies options for Template:Codeline
Username used to mount the share
The shared directory's password
Used to specify the workgroup
The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)
Note: Abstain from using trailing directory (/) characters. Using Template:Filename will not work.

3. To unmount the share, use:

# umount /mnt/MOUNTPOINT

Adding the share to Template:Filename

Add the following to Template:Filename for easy mounting:

//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,users,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0

The Template:Codeline option disables mounting it automatically at boot and Template:Codeline increases performance by skipping inode access times.

After adding the previous line, the syntax to mount files becomes simpler:

# mount /mnt/MOUNTPOINT

Allowing users to mount

Before enabling access to the mount commands, Template:Filename needs to be modified. Add the Template:Codeline options to the entry in Template:Filename:

//SERVER/SHARENAME /mnt/SHAREMOUNT cifs users,noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0
Note: The option is Template:Codeline (plural). For other filesystem types handled by mount, this option is usually user; sans the "s".

For users to be allowed to mount and unmount the Samba share, the setuid flag must be activated on the following two files to allow users to execute the commands with elevated privileges:

# chmod u+s /sbin/mount.cifs
# chmod u+s /sbin/umount.cifs
Warning: A more secure option is to use sudo to grant privileges. Setting the setuid bit is potentially dangerous and is not recommended.