Difference between revisions of "Windows Network Share"

From ArchWiki
Jump to: navigation, search
m (remove intro stub)
Line 2: Line 2:
[[Category:HOWTOs (English)]]
[[Category:HOWTOs (English)]]
{{Article summary start}}
{{Article summary start}}
{{Article summary text|An overview of methods available to users wishing to access Windows shares.}}
{{Article summary text|An overview of methods available to users wishing to access Windows shares using [[Samba]].}}
{{Article summary heading|Available in languages}}
{{Article summary heading|Available in languages}}
{{i18n entry|English|Windows Network Share}}
{{i18n entry|English|Windows Network Share}}
Line 9: Line 9:
{{Article summary wiki|Samba}}
{{Article summary wiki|Samba}}
{{Article summary end}}
{{Article summary end}}
This article covers accessing Windows shares using [[Samba]].
Install the {{Package Official|smbclient}} package with [[pacman]]:
Install the {{Package Official|smbclient}} package with [[pacman]]:

Revision as of 14:52, 1 January 2010

Summary help replacing me
An overview of methods available to users wishing to access Windows shares using Samba.
Available in languages

Template:I18n entry

Related articles


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 the Autofs wiki article 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".
Warning: A more secure option is to use sudo to grant privileges. Setting the setuid bit is potentially dangerous and is not recommended.

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