Difference between revisions of "Samba (正體中文)"

From ArchWiki
Jump to navigation Jump to search
(mark poor writing)
(update interlanguage links)
Tag: wiki-scripts
 
(17 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
[[Category:正體中文]]
 
[[Category:正體中文]]
[[Category:HOWTOs (正體中文)]]
+
[[Category:Networking (正體中文)]]
{{i18n|Samba}}
+
[[cs:Samba]]
{{Poor writing}}
+
[[da:Samba]]
 +
[[de:Samba]]
 +
[[en:Samba]]
 +
[[es:Samba]]
 +
[[fr:Samba]]
 +
[[it:Samba]]
 +
[[ja:Samba]]
 +
[[ru:Samba]]
 +
[[sr:Samba]]
 +
[[zh-hans:Samba]]
 +
{{Related articles start}}
 +
{{Related|Active Directory Integration}}
 +
{{Related|Samba/Active Directory domain controller}}
 +
{{Related|SOGo}}
 +
{{Related|NFS}}
 +
{{Related articles end}}
 +
{{翻譯狀態|Samba|2015-01-22|357593}}
  
安裝samba服務可以與Windows進行文件的共享<br />
+
'''Samba''' is a re-implementation of the [[wikipedia:Server_Message_Block|SMB/CIFS]] networking protocol, it facilitates file and printer sharing among Linux and Windows systems as an alternative to [[NFS]]. Some users say that Samba is easily configured and that operation is very straight-forward. However, many new users run into problems with its complexity and non-intuitive mechanism. It is strongly suggested that the user sticks close to the following directions.
下面是在Arch下的簡單安裝方法:<br />
 
- pacman -S samba<br />
 
- (root) cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
 
- (root) vim /etc/samba/smb.conf (或者使用其他的編輯器)<br />
 
  
[globle]選項塊<br />
+
== Server configuration ==
workgroup = HOME    # 組名,在Windows中默認是MSHOME或者WORKGROUP<br />
+
 
netbios name = ZelluX # 在網上鄰居中顯示的機器名<br />
+
To share files with Samba, [[pacman#Installing specific packages|install]] {{Pkg|samba}}, from the [[official repositories]].
encrypt passwords = yes # 應該設為yes。但是如果要在Windows 98/95上訪問你的服務器,得把這個設為no,因為它們不支持密碼的加密傳輸。<br />
+
 
<br />
+
The Samba server is configured in {{ic|/etc/samba/smb.conf}}. Copy the default Samba configuration file to {{ic|/etc/samba/smb.conf}}:
[homes]選項塊<br />
+
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf
最簡單的配置(登陸後方可訪問):<br />
+
 
browseable = no<br />
+
{{Tip|Run {{ic|testparm}} to check the validity of ''samba'' configuration file.}}
read only = no   # 或者writable = yes<br />
+
 
<br />
+
=== Creating a share ===
匿名可讀,登陸後可以修改:<br />
+
 
public = yes<br />
+
Edit {{ic|/etc/samba/smb.conf}}, scroll down to the '''Share Definitions''' section. The default configuration automatically creates a share for each user's home directory. It also creates a share for printers by default. There are a number of commented sample configurations included. More information about available options for shared resources can be found in {{man|5|smb.conf}}. [http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html Here] is the on-line version.
writable = yes<br />
+
 
write list = @staff<br />
+
On Windows side, be sure to change {{ic|smb.conf}} to the Windows Workgroup. (Windows default: WORKGROUP)
<br />
+
 
如果想讓Windows用戶看到一個清晰的目錄(隱藏.開頭的文件,比如~/.bashrc):<br />
+
=== Starting services ===
[homes]<br />
+
 
path = /home/%u/smb<br />
+
To provide basic file sharing through SMB [[Systemd#Using units|start/enable]] {{ic|smbd.service}} and {{ic|nmbd.service}} services. See [http://www.samba.org/samba/docs/man/manpages-3/smbd.8.html smbd] and [http://www.samba.org/samba/docs/man/manpages-3/nmbd.8.html nmbd] manpages for details.
browseable = no<br />
+
 
read only = no<br />
+
{{Tip|Instead of having the service running since boot, you can enable {{ic|smbd.socket}} so the daemon is started on the first incoming connection. Don't forget to disable {{ic|smbd.service}}.}}
同時要在每位用戶的主目錄下建立一個smb目錄。可以通過在/etc/skel目錄下建立smb,從而自動在所有用戶目錄下建立該目錄<br />
+
 
mkdir /etc/skel/smb<br />
+
=== Creating usershare path ===
<br />
+
{{Note|This is an optional feature. Skip this section if you don't need it.}}
要共享其他的目錄也很容易,衹要設置path和valid users屬性即可<br />
+
 
[music]<br />
+
"Usershare" is a feature that gives non-root users the capability to add, modify, and delete their own share definitions.
path = /mnt/windows/Music/<br />
+
 
browseable = yes<br />
+
This creates the usershares directory in {{ic|/var/lib/samba}}:
read only = yes<br />
+
 
valid users = Bryan, Michael, David, Jane<br />
+
  # mkdir -p /var/lib/samba/usershare
valid users屬性指定登陸後有權限訪問到這個目錄的用戶<br />
+
 
<br />
+
This makes the group sambashare:
- (root) 使用 smbpasswd -a 用戶名 增加允許登陸的用戶,並指定他們的登陸密碼<br />
+
 
- (root) /etc/rc.d/samba stop 停止samba服務<br />
+
# groupadd sambashare
- (root) /etc/rc.d/samba start 啟動samba服務<br />
+
 
<br />
+
This changes the owner of the directory and group you just created to root:
 +
 
 +
# chown root:sambashare /var/lib/samba/usershare
 +
 
 +
This changes the permissions of the usershares directory so that users in the group sambashare can read, write and execute files:
 +
 
 +
  # chmod 1770 /var/lib/samba/usershare
 +
 
 +
Set the following variables in {{ic|smb.conf}} configuration file:
 +
 
 +
{{hc|/etc/samba/smb.conf|2=
 +
...
 +
[global]
 +
  usershare path = /var/lib/samba/usershare
 +
  usershare max shares = 100
 +
  usershare allow guests = yes
 +
  usershare owner only = yes
 +
   ...
 +
}}
 +
 
 +
Add your user to the ''sambashare'' group. Replace {{ic|''your_username''}} with the name of your user:
 +
 
 +
# usermod -a -G sambashare ''your_username''
 +
 
 +
Restart {{ic|smbd}} and {{ic|nmbd}} services.
 +
 
 +
Log out and log back in. You should now be able to configure your samba share using GUI. For example, in [[Thunar]] you can right click on any directory and share it on the network. If you want to share pathes inside your home directory you must make it listable for the group others.
 +
 
 +
=== Adding a user ===
 +
 
 +
Create a [[Users and groups#User management|Linux user account]] for ''samba'' user.  Substitute {{ic|''samba_user''}} with preferred name if desired:
 +
 
 +
# useradd ''samba_user''
 +
 
 +
Then create a ''Samba'' user account with the same name:
 +
 
 +
# pdbedit -a -u ''samba_user''
 +
 
 +
=== Changing Samba user's password ===
 +
 
 +
To change a user's password, use {{ic|smbpasswd}}:
 +
 
 +
# smbpasswd ''samba_user''
 +
 
 +
=== Required ports ===
 +
 
 +
If running a [[firewall]], don't forget to open required [https://wiki.samba.org/index.php/Samba_port_usage Samba ports].
 +
 
 +
== Client configuration ==
 +
 
 +
Only {{Pkg|smbclient}} is required to access files from a Samba/SMB/CIFS server. It is available from the official repositories.
 +
 
 +
Shared resources from other computers on the LAN may be accessed and mounted locally by GUI or CLI methods. Depending on the [[desktop environment]], GUI methods may not be available. See also [[#File manager configuration]] for use with a file manager.
 +
 
 +
There are two parts in sharing access. The first is the underlying file system mechanism, which some environments have built in. The second is the interface which allows the user to mount shared resources.
 +
 
 +
=== Manual mounting ===
 +
 
 +
For a lighter approach without support  for listing public shares, only install {{Pkg|cifs-utils}} to provide {{ic|/usr/bin/mount.cifs}}.
 +
 
 +
To list public shares on a server:
 +
 
 +
$ smbclient -L ''hostname'' -U%
 +
 
 +
Create a mount point for the share:
 +
 
 +
# mkdir /mnt/''mountpoint''
 +
 
 +
Mount the share using the {{ic|mount.cifs}} type. Not all the options listed below are needed or desirable (ie. {{ic|password}}).
 +
 
 +
{{bc|1=
 +
# mount -t cifs //''SERVER''/''sharename'' /mnt/''mountpoint'' -o user=''username'',password=''password'',workgroup=''workgroup'',ip=''serverip''
 +
}}
 +
 
 +
''SERVER''
 +
: The Windows system name.
 +
 
 +
''sharename''
 +
: The shared directory.
 +
 
 +
''mountpoint''
 +
: The local directory where the share will be mounted.
 +
 
 +
{{ic|<nowiki>-o [options]</nowiki>}}
 +
: See {{man|8|mount.cifs}} for more information.
 +
 
 +
{{Note|
 +
* Abstain from using a trailing {{ic|/}}. {{ic|//''SERVER''/''sharename'''''/'''}} will not work.
 +
* If your mount does not work stable, stutters or freezes, try to enable different SMB protocol version with {{ic|1=vers=}} option. For example, {{ic|1=vers=2.0}} for Windows Vista mount.
 +
}}
 +
 
 +
==== Add Share to /etc/fstab ====
 +
 
 +
The simplest way to add an fstab entry is something like this:
 +
 
 +
{{hc|/etc/fstab|2=
 +
//''SERVER''/''sharename'' /mnt/''mountpoint'' cifs username=''username'',password=''password'' 0 0
 +
}}
 +
 
 +
However, storing passwords in a world readable file is not recommended! A safer method would be to use a credentials file. As an example, create a file and {{ic|chmod 600 ''filename''}} so only the owning user can read and write to it. It should contain the following information:
 +
 
 +
{{hc|/path/to/credentials/sambacreds|2=
 +
username=''username''
 +
password=''password''
 +
}}
 +
 
 +
and the line in your fstab should look something like this:
 +
 
 +
{{hc|/etc/fstab|2=
 +
//SERVER/SHARENAME /mnt/''mountpoint'' cifs credentials=''/path/to/credentials/sambacreds'' 0 0
 +
}}
 +
 
 +
If using ''systemd'' (modern installations), one can utilize the {{ic|1=comment=systemd.automount}} option, which speeds up service boot by a few seconds. Also, one can map current user and group to make life a bit easier, utilizing {{ic|uid}} and {{ic|gid}} options.
 +
 
 +
{{Warning|Using the {{ic|uid}} and {{ic|gid}} options may cause input ouput errors in programs that try to fetch data from network drives.}}
 +
 
 +
{{hc|/etc/fstab|2=
 +
//''SERVER''/''SHARENAME'' /mnt/''mountpoint'' cifs credentials=''/path/to/smbcredentials'',comment=systemd.automount,uid=''username'',gid=''usergroup'' 0 0
 +
}}
 +
 
 +
{{Note|Space in sharename should be replaced by {{ic|\040}} (ASCII code for space in octal). For example, {{ic|//''SERVER''/share name}} on the command line should be {{ic|//''SERVER''/share\040name}} in {{ic|/etc/fstab}}.}}
 +
 
 +
==== User mounting ====
 +
 
 +
{{hc|/etc/fstab|2=
 +
//''SERVER''/''SHARENAME'' /mnt/''mountpoint'' cifs users,credentials=''/path/to/smbcredentials'',workgroup=''workgroup'',ip=''serverip'' 0 0
 +
}}
 +
 
 +
{{Note|The option is user'''s''' (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}
 +
 
 +
This will allow users to mount it as long as the mount point resides in a directory controllable by the user; i.e. the user's home. For users to be allowed to mount and unmount the Samba shares with mount points that they do not own, use [[#smbnetfs|smbnetfs]], or grant privileges using [[sudo]].
 +
 
 +
=== WINS host names ===
 +
 
 +
The {{pkg|smbclient}} package provides a driver to resolve host names using WINS. To enable it, add “wins” to the “hosts” line in /etc/nsswitch.conf.
 +
 
 +
=== Automatic mounting ===
 +
 
 +
There are several ways to easily browse shared resources:
 +
 
 +
==== smbnetfs ====
 +
 
 +
{{Note|1=smbnetfs needs an intact Samba server setup.
 +
See above on how to do that.}}
 +
 
 +
First, check if you can see all the shares you are interested in mounting:
 +
$ smbtree -U ''remote_user''
 +
 
 +
If that does not work, find and modify the following line
 +
in {{ic|/etc/samba/smb.conf}} accordingly:
 +
 
 +
domain master = auto
 +
 
 +
Now [[systemd#Using units|restart]] {{ic|smbd.service}} and {{ic|nmbd.service}}.
 +
 
 +
If everything works as expected, [[pacman#Installing specific packages|install]] {{Pkg|smbnetfs}} from the official repositories.
 +
 
 +
Then, add the following line to {{ic|/etc/fuse.conf}}:
 +
 
 +
user_allow_other
 +
 
 +
and load the {{ic|fuse}} [[kernel module]]:
 +
 
 +
# modprobe fuse
 +
 
 +
Now copy the directory {{ic|/etc/smbnetfs/.smb}} to your home directory:
 +
 
 +
$ cp -a /etc/smbnetfs/.smb ~
 +
 
 +
Then create a link to {{ic|smb.conf}}:
 +
 
 +
$ ln -sf /etc/samba/smb.conf ~/.smb/smb.conf
 +
 
 +
If a username and a password are required to access some of the shared folders, edit {{ic|~/.smb/smbnetfs.auth}}
 +
to include one or more entries like this:
 +
 
 +
{{hc|~/.smb/smbnetfs.auth|
 +
auth "hostname" "username" "password"
 +
}}
 +
 
 +
It is also possible to add entries for specific hosts to be mounted by smbnetfs, if necessary.
 +
More details can be found in {{ic|~/.smb/smbnetfs.conf}}.
 +
 
 +
If you are using the Dolphin or Nautilus file managers, you may want to the following to {{ic|~/.smb/smbnetfs.conf}} to avoid "Disk full" errors as smbnetfs by default will report 0 bytes of free space:
 +
{{hc|~/.smb/smbnetfs.conf|
 +
free_space_size 1073741824
 +
}}
 +
 
 +
When you are done with the configuration, you need to run
 +
  $ chmod 600 ~/.smb/smbnetfs.*
 +
Otherwise, smbnetfs complains about 'insecure config file permissions'.
 +
 
 +
Finally, to mount your Samba network neighbourhood to a directory of your choice, call
 +
$ smbnetfs ''mount_point''
 +
 
 +
===== Daemon =====
 +
 
 +
The Arch Linux package also maintains an additional system-wide operation mode for smbnetfs. To enable it, you need to make the
 +
said modifications in the directoy {{ic|/etc/smbnetfs/.smb}}.
 +
 
 +
Then, you can start and/or enable the {{ic|smbnetfs}} [[daemon]] as usual. The system-wide mount point is at {{ic|/mnt/smbnet/}}.
 +
 
 +
==== autofs ====
 +
 
 +
See [[Autofs]] for information on the kernel-based automounter for Linux.
 +
 
 +
=== File manager configuration ===
 +
 
 +
==== GNOME Files, Nemo, Thunar and PCManFM ====
 +
 
 +
In order to access samba shares through GNOME Files, Nemo, Thunar or PCManFM, install the {{Pkg|gvfs-smb}} package, available in the [[official repositories]].
 +
 
 +
Press {{ic|Ctrl+l}} and enter {{ic|smb://''servername''/''share''}} in the location bar to access your share.
 +
 
 +
The mounted share is likely to be present at {{ic|/run/user/''your_UID''/gvfs}} in the filesystem.
 +
 
 +
==== KDE ====
 +
 
 +
KDE, has the ability to browse Samba shares built in. Therefore do not need any additional packages. However, for a GUI in the KDE System Settings, install the {{Pkg|kdenetwork-filesharing}} package from the official repositories.
 +
 
 +
If when navigating with Dolphin you get a "Time Out" Error, you should uncomment and edit this line in smb.conf:{{bc|1=name resolve order = lmhosts bcast host wins}}
 +
as shown in this [http://ubuntuforums.org/showthread.php?t=1605499 page].
 +
 
 +
==== Other graphical environments ====
 +
 
 +
There are a number of useful programs, but they may need to have packages created for them. This can be done with the Arch package build system. The good thing about these others is that they do not require a particular environment to be installed to support them, and so they bring along less baggage.
 +
 
 +
* {{Pkg|pyneighborhood}} is available in the official repositories.
 +
* LinNeighborhood, RUmba, xffm-samba plugin for Xffm are not available in the official repositories or the AUR. As they are not officially (or even unofficially supported), they may be obsolete and may not work at all.
 +
 
 +
== See also ==
 +
 
 +
* [http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]
 +
* [http://www.samba.org/ Official Samba site]

Latest revision as of 22:17, 13 December 2017

翻譯狀態: 本文章是 Samba 的翻譯版本。最近一次的翻譯時間:2015-01-22。點擊本連結查看英文頁面之後的變更。

Samba is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing among Linux and Windows systems as an alternative to NFS. Some users say that Samba is easily configured and that operation is very straight-forward. However, many new users run into problems with its complexity and non-intuitive mechanism. It is strongly suggested that the user sticks close to the following directions.

Server configuration

To share files with Samba, install samba, from the official repositories.

The Samba server is configured in /etc/samba/smb.conf. Copy the default Samba configuration file to /etc/samba/smb.conf:

# cp /etc/samba/smb.conf.default /etc/samba/smb.conf
Tip: Run testparm to check the validity of samba configuration file.

Creating a share

Edit /etc/samba/smb.conf, scroll down to the Share Definitions section. The default configuration automatically creates a share for each user's home directory. It also creates a share for printers by default. There are a number of commented sample configurations included. More information about available options for shared resources can be found in smb.conf(5). Here is the on-line version.

On Windows side, be sure to change smb.conf to the Windows Workgroup. (Windows default: WORKGROUP)

Starting services

To provide basic file sharing through SMB start/enable smbd.service and nmbd.service services. See smbd and nmbd manpages for details.

Tip: Instead of having the service running since boot, you can enable smbd.socket so the daemon is started on the first incoming connection. Don't forget to disable smbd.service.

Creating usershare path

Note: This is an optional feature. Skip this section if you don't need it.

"Usershare" is a feature that gives non-root users the capability to add, modify, and delete their own share definitions.

This creates the usershares directory in /var/lib/samba:

# mkdir -p /var/lib/samba/usershare

This makes the group sambashare:

# groupadd sambashare

This changes the owner of the directory and group you just created to root:

# chown root:sambashare /var/lib/samba/usershare

This changes the permissions of the usershares directory so that users in the group sambashare can read, write and execute files:

# chmod 1770 /var/lib/samba/usershare

Set the following variables in smb.conf configuration file:

/etc/samba/smb.conf
...
[global]
  usershare path = /var/lib/samba/usershare
  usershare max shares = 100
  usershare allow guests = yes
  usershare owner only = yes
  ...

Add your user to the sambashare group. Replace your_username with the name of your user:

# usermod -a -G sambashare your_username

Restart smbd and nmbd services.

Log out and log back in. You should now be able to configure your samba share using GUI. For example, in Thunar you can right click on any directory and share it on the network. If you want to share pathes inside your home directory you must make it listable for the group others.

Adding a user

Create a Linux user account for samba user. Substitute samba_user with preferred name if desired:

# useradd samba_user

Then create a Samba user account with the same name:

# pdbedit -a -u samba_user

Changing Samba user's password

To change a user's password, use smbpasswd:

# smbpasswd samba_user

Required ports

If running a firewall, don't forget to open required Samba ports.

Client configuration

Only smbclient is required to access files from a Samba/SMB/CIFS server. It is available from the official repositories.

Shared resources from other computers on the LAN may be accessed and mounted locally by GUI or CLI methods. Depending on the desktop environment, GUI methods may not be available. See also #File manager configuration for use with a file manager.

There are two parts in sharing access. The first is the underlying file system mechanism, which some environments have built in. The second is the interface which allows the user to mount shared resources.

Manual mounting

For a lighter approach without support for listing public shares, only install cifs-utils to provide /usr/bin/mount.cifs.

To list public shares on a server:

$ smbclient -L hostname -U%

Create a mount point for the share:

# mkdir /mnt/mountpoint

Mount the share using the mount.cifs type. Not all the options listed below are needed or desirable (ie. password).

# mount -t cifs //SERVER/sharename /mnt/mountpoint -o user=username,password=password,workgroup=workgroup,ip=serverip

SERVER

The Windows system name.

sharename

The shared directory.

mountpoint

The local directory where the share will be mounted.

-o [options]

See mount.cifs(8) for more information.
Note:
  • Abstain from using a trailing /. //SERVER/sharename/ will not work.
  • If your mount does not work stable, stutters or freezes, try to enable different SMB protocol version with vers= option. For example, vers=2.0 for Windows Vista mount.

Add Share to /etc/fstab

The simplest way to add an fstab entry is something like this:

/etc/fstab
//SERVER/sharename /mnt/mountpoint cifs username=username,password=password 0 0

However, storing passwords in a world readable file is not recommended! A safer method would be to use a credentials file. As an example, create a file and chmod 600 filename so only the owning user can read and write to it. It should contain the following information:

/path/to/credentials/sambacreds
username=username
password=password

and the line in your fstab should look something like this:

/etc/fstab
//SERVER/SHARENAME /mnt/mountpoint cifs credentials=/path/to/credentials/sambacreds 0 0

If using systemd (modern installations), one can utilize the comment=systemd.automount option, which speeds up service boot by a few seconds. Also, one can map current user and group to make life a bit easier, utilizing uid and gid options.

Warning: Using the uid and gid options may cause input ouput errors in programs that try to fetch data from network drives.
/etc/fstab
//SERVER/SHARENAME /mnt/mountpoint cifs credentials=/path/to/smbcredentials,comment=systemd.automount,uid=username,gid=usergroup 0 0
Note: Space in sharename should be replaced by \040 (ASCII code for space in octal). For example, //SERVER/share name on the command line should be //SERVER/share\040name in /etc/fstab.

User mounting

/etc/fstab
//SERVER/SHARENAME /mnt/mountpoint cifs users,credentials=/path/to/smbcredentials,workgroup=workgroup,ip=serverip 0 0
Note: The option is users (plural). For other filesystem types handled by mount, this option is usually user; sans the "s".

This will allow users to mount it as long as the mount point resides in a directory controllable by the user; i.e. the user's home. For users to be allowed to mount and unmount the Samba shares with mount points that they do not own, use smbnetfs, or grant privileges using sudo.

WINS host names

The smbclient package provides a driver to resolve host names using WINS. To enable it, add “wins” to the “hosts” line in /etc/nsswitch.conf.

Automatic mounting

There are several ways to easily browse shared resources:

smbnetfs

Note: smbnetfs needs an intact Samba server setup. See above on how to do that.

First, check if you can see all the shares you are interested in mounting:

$ smbtree -U remote_user

If that does not work, find and modify the following line in /etc/samba/smb.conf accordingly:

domain master = auto

Now restart smbd.service and nmbd.service.

If everything works as expected, install smbnetfs from the official repositories.

Then, add the following line to /etc/fuse.conf:

user_allow_other

and load the fuse kernel module:

# modprobe fuse

Now copy the directory /etc/smbnetfs/.smb to your home directory:

$ cp -a /etc/smbnetfs/.smb ~

Then create a link to smb.conf:

$ ln -sf /etc/samba/smb.conf ~/.smb/smb.conf

If a username and a password are required to access some of the shared folders, edit ~/.smb/smbnetfs.auth to include one or more entries like this:

~/.smb/smbnetfs.auth
auth			"hostname" "username" "password"

It is also possible to add entries for specific hosts to be mounted by smbnetfs, if necessary. More details can be found in ~/.smb/smbnetfs.conf.

If you are using the Dolphin or Nautilus file managers, you may want to the following to ~/.smb/smbnetfs.conf to avoid "Disk full" errors as smbnetfs by default will report 0 bytes of free space:

~/.smb/smbnetfs.conf
free_space_size 1073741824

When you are done with the configuration, you need to run

$ chmod 600 ~/.smb/smbnetfs.*

Otherwise, smbnetfs complains about 'insecure config file permissions'.

Finally, to mount your Samba network neighbourhood to a directory of your choice, call

$ smbnetfs mount_point
Daemon

The Arch Linux package also maintains an additional system-wide operation mode for smbnetfs. To enable it, you need to make the said modifications in the directoy /etc/smbnetfs/.smb.

Then, you can start and/or enable the smbnetfs daemon as usual. The system-wide mount point is at /mnt/smbnet/.

autofs

See Autofs for information on the kernel-based automounter for Linux.

File manager configuration

GNOME Files, Nemo, Thunar and PCManFM

In order to access samba shares through GNOME Files, Nemo, Thunar or PCManFM, install the gvfs-smb package, available in the official repositories.

Press Ctrl+l and enter smb://servername/share in the location bar to access your share.

The mounted share is likely to be present at /run/user/your_UID/gvfs in the filesystem.

KDE

KDE, has the ability to browse Samba shares built in. Therefore do not need any additional packages. However, for a GUI in the KDE System Settings, install the kdenetwork-filesharing package from the official repositories.

If when navigating with Dolphin you get a "Time Out" Error, you should uncomment and edit this line in smb.conf:

name resolve order = lmhosts bcast host wins

as shown in this page.

Other graphical environments

There are a number of useful programs, but they may need to have packages created for them. This can be done with the Arch package build system. The good thing about these others is that they do not require a particular environment to be installed to support them, and so they bring along less baggage.

  • pyneighborhood is available in the official repositories.
  • LinNeighborhood, RUmba, xffm-samba plugin for Xffm are not available in the official repositories or the AUR. As they are not officially (or even unofficially supported), they may be obsolete and may not work at all.

See also