https://wiki.archlinux.org/api.php?action=feedcontributions&user=Pwd&feedformat=atomArchWiki - User contributions [en]2024-03-29T14:34:19ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Dwm&diff=90738Dwm2010-01-02T19:44:30Z<p>Pwd: /* Basic statusbar */ missing 'exec dwm'</p>
<hr />
<div>[[Category:Desktop environments (English)]] [[Category:HOWTOs (English)]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Information on installing dwm and increasing its potential}}<br />
{{Article summary heading|Language}}<br />
{{i18n_entry|English|dwm}}<br />
{{i18n_entry|Русский|Dwm (Русский)}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|dmenu}}<br />
{{Article summary wiki|wmii}}<br />
{{Article summary end}}<br />
{{DISPLAYTITLE:dwm}}<br />
[http://dwm.suckless.org/ dwm] is a dynamic window manager for [[X]]. It manages windows in tiled, stacked, and full-screen layouts, as well as many others with the help of optional patches. Layouts can be applied dynamically, optimizing the environment for the application in use and the task performed. dwm is extremely lightweight and fast, written in C and with a stated design goal of remaining under 2000 source lines of code. It provides multi-head support for xrandr and Xinerama.<br />
<br />
==Installing==<br />
These instructions will install dwm using [[makepkg]] along with the Arch Build System, or [[ABS]] for short. This will allow reconfiguring it at a later time without complications. If only interested in installing dwm for a test drive, simply install the binary package from the repositories instead:<br />
# pacman -S dwm<br />
<br />
Note that by omitting compiling dwm from source a great deal of customizability is lost, since dwm's entire configuration is performed by editing its source code. Taking this in mind, the rest of the article assumes that dwm has been compiled from source as explained in the entirety of this section.<br />
<br />
===Requirements===<br />
Basic programming tools present in {{package Official|base-devel}} are needed in order to compile dwm and build a package for it, and the {{package Official|abs}} package is also a requisite for fetching the necessary build scripts:<br />
# pacman -S base-devel abs<br />
<br />
===Download build scripts with ABS===<br />
Once the required packages are installed, use ABS to fetch the latest build scripts from the repositories:<br />
# abs<br />
<br />
Lastly, copy the dwm build scripts from the ABS tree to a temporary directory. For example:<br />
$ cp -r /var/abs/community/dwm ~/dwm<br />
<br />
===Build and install package===<br />
Use {{Codeline|cd}} by switching to the directory containing the build scripts (the example above used {{Filename|~/dwm}}). Then run:<br />
$ makepkg -i<br />
<br />
This will compile dwm, build an Arch Linux package containing the resulting files, and install the package file all in one step. If problems are encountered, review the output for specific information. <br />
<br />
{{Tip|If this directory ({{filename|~/dwm}}) is saved, it can be posteriorly used for making changes to the default configuration.}}<br />
<br />
==Configuring==<br />
dwm, as mentioned before, is exclusively configured at compile-time via some of its source files, namely {{Filename|config.h}} and {{Filename|config.mk}}. While the initial configuration provides a good set of defaults, it's realistic to expect that at some point potential users will probably want to make adjustments to their setups.<br />
<br />
===Method 1: ABS rebuild (recommended)===<br />
Modifying dwm is quite simple using this route.<br />
<br />
====Customizing config.h====<br />
Browse to the dwm source code directory saved during the [[#Installing|installation process]]; {{filename|~/dwm}} in the example. The {{filename|config.h}} found within this directory is where the general dwm preferences are stored. Most settings within the file should be self-explanatory, while others may not share the same trait. For detailed information on these settings, see the [http://www.suckless.org/dwm/ dwm website].<br />
<br />
{{note|Be sure to make a backup copy of config.h before modifying it, just in case something goes wrong.}}<br />
<br />
Once changes have been made, pipe the new md5sums into the [[PKGBUILD]]:<br />
$ makepkg -g >> PKGBUILD<br />
This will eliminate a checksum mismatch between the official config.h and the new revised copy.<br />
<br />
Now, compile and reinstall:<br />
$ makepkg -efi<br />
<br />
Assuming the configuration changes were valid, this command will compile dwm, build and reinstall the resulting package. If problems were encountered, review the output for specific information.<br />
<br />
Finally, restart dwm in order to apply the changes.<br />
<br />
====Notes====<br />
From now on, instead of updating the md5sums for every {{filename|config.h}} revision, which are known to become frequent, one may erase the md5sums array and build dwm with the {{codeline|--skipinteg}} option:<br />
$ makepkg -efi --skipinteg<br />
<br />
And after adding a few lines to dwm's start-up script, it is possible to [[#Restart dwm without logging out or closing programs|restart dwm without logging out or closing programs]].<br />
<br />
===Method 2: Mercurial (advanced)===<br />
dwm is maintained upstream within a [http://www.selenic.com/mercurial/wiki/ Mercurial] version control system. If already familiar with Mercurial, then maintaining configurations and patches within this system may be more convenient. A [http://www.suckless.org/dwm/customisation/patch_queue.html detailed tutorial] on this method is available at the dwm website.<br />
<br />
Before building dwm from the Mercurial sources, be sure to alter config.mk accordingly, because failure to do so may result in X crashes. Here are the values that need changing:<br />
<br />
Modify {{codeline|PREFIX}}:<br />
PREFIX = /usr<br />
The X11 include folder:<br />
X11INC = /usr/include/X11<br />
And the the X11 lib directory:<br />
X11LIB = /usr/lib/X11<br />
<br />
==Starting dwm==<br />
To start dwm with {{Codeline|startx}} or the [[SLIM]] login manager, simply append the following to {{Filename|~/.xinitrc}}: <br />
exec dwm<br />
<br />
For [[GDM]], add it to {{Filename|~/.Xclients}} instead, and select "Run XClient Script" from the Sessions menu.<br />
<br />
==Statusbar configuration==<br />
dwm uses {{Codeline|xsetroot -name}} to display information in its statusbar.<br />
<br />
===Basic statusbar===<br />
This example prints the date in [http://en.wikipedia.org/wiki/ISO_8601 ISO 8601] format. Add it to files {{filename|~/.xinitrc}} or {{filename|~/.Xclients}}:<br />
<pre><br />
while true<br />
do<br />
xsetroot -name "$( date +"%F %R" )"<br />
sleep 1m # Update time every minute<br />
done &<br />
exec dwm<br />
</pre><br />
<br />
Here is an example intended for laptops that depends on the {{Package Official|acpi}} package for showing battery information:<br />
<pre><br />
while true <br />
do<br />
xsetroot -name "$( acpi -b | awk '{ print $3, $4 }' | tr -d ',' )"<br />
done &<br />
exec dwm<br />
</pre><br />
<br />
The script displays the amount of battery remaining and its charging status by using the awk command to trim away the unneeded text from acpi, and tr to remove the commas.<br />
<br />
An alternative to the above is to selectively show the battery status depending on the current charging state:<br />
<pre><br />
while true; do<br />
batt_main="$( LC_ALL=C acpi -b )"<br />
<br />
case "$batt_main" in<br />
*Discharging*)<br />
batt_main="${batt_main#* * * }"<br />
batt_main="${batt_main%%? *} "<br />
;;<br />
*)<br />
batt_main=''<br />
;;<br />
esac<br />
<br />
xsetroot -name "$batt_main$( date +"%R" )"<br />
sleep 1m<br />
done &<br />
exec dwm<br />
</pre><br />
<br />
Finally, make sure there is only one instance of dwm in {{filename|~/.xinitrc}} or {{filename|~/.Xclients}}. So combining everything together should resemble this:<br />
~/.setbg<br />
autocutsel&<br />
termirssi&<br />
urxvt&<br />
while true<br />
do<br />
xsetroot -name "$(date +"%F %R")"<br />
sleep 1m # Update time every minute<br />
done &<br />
'''exec dwm'''<br />
<br />
===Conky statusbar===<br />
Available from the [[AUR]], {{package AUR|conky-cli}} is a special build of conky which prints to <tt>stdout</tt>. If already accustomed to [[conky]], a statusbar rich with information can be ready within minutes. Once conky has been configured to preference, simply print it to the statusbar via the {{Codeline|xsetroot -name}} argument:<br />
conky | while true; read line; do xsetroot -name "$line"; done &<br />
exec dwm<br />
<br />
The following is a sample conkyrc for a dual core CPU, displaying several stats:<br />
<pre><br />
background no<br />
out_to_console yes<br />
update_interval 2<br />
total_run_times 0<br />
use_spacer none<br />
<br />
TEXT<br />
$mpd_smart :: ${cpu cpu1}% / ${cpu cpu2}% ${loadavg 1} ${loadavg 2 3} :: ${acpitemp}c :: $memperc% ($mem) :: ${downspeed eth0}K/s ${upspeed eth0}K/s :: ${time %a %b %d %I:%M%P}<br />
</pre><br />
<br />
==Extended usage==<br />
<br />
===Patches & additional tiling modes===<br />
The official website is full of [http://www.suckless.org/dwm/patches patches] that can add extra functionality to dwm. Users can easily customize dwm by applying the modifications they like. The [http://www.suckless.org/dwm/patches/bottom_stack.html Bottom Stack] patch provides an additional tiling mode that splits the screen horizontally, as opposed to the default vertically oriented tiling mode.<br />
<br />
===Fixing gaps around terminal windows===<br />
If there are empty gaps of desktop space outside terminal windows, it is likely due to the terminal's font size. Either adjust the size until finding the ideal scale that closes the gap, or toggle {{Codeline|resizehints}} to ''False'' in {{filename|config.h}}:<br />
static Bool resizehints = False; /* False means respect size hints in tiled resizals */<br />
<br />
This will cause dwm to ignore resize requests from all client windows, not just terminals. The downside to this workaround is that some terminals may suffer redraw anomalies, such as ghost lines and premature line wraps, among others.<br />
<br />
====Urxvt====<br />
Another choice for [[urxvt]] users is applying the [[urxvt#Fix maximized window gaps|hints patch]] and regressing to dwm's original behaviour:<br />
static Bool resizehints = '''True''';<br />
<br />
===Restart dwm without logging out or closing programs===<br />
For restarting dwm without logging out or closing applications, change or add a startup script so that it loads dwm in a ''while'' loop, like this:<br />
<pre><br />
conky | while read line; do<br />
xsetroot -name "$line"<br />
done | while true; do<br />
# Log stderror to a file <br />
dwm 2> ~/.dwm.log; done<br />
# No error logging<br />
#dwm > /dev/null; done<br />
</pre><br />
<br />
dwm can now be restarted without destroying other X windows by pressing the usual Mod-Shift-Q combination.<br />
<br />
It's a good idea to place the above startup script into a separate file, {{Filename|~/bin/startdwm}} for instance, and execute it through {{filename|~/.xinitrc}}. From this point on, when desiring to actually end the X session simply execute {{Codeline|killall startdwm}}, or bind it to a convenient key.<br />
<br />
===Make the right Alt key work as if it were Mod4 (Windows Key)===<br />
When using Mod4 (aka Super/Windows Key) as the {{codeline|MODKEY}}, it may be equally convenient to have the right Alt key (Alt_R) act as Mod4. This will allow performing otherwise awkward keystrokes one-handed, such as zooming with Alt_R+Enter. <br />
<br />
First, find out which keycode is assigned to Alt_R:<br />
xmodmap -pke | grep Alt_R<br />
<br />
Then simply add the following to the startup script (e.g. {{filename|~/.xinitrc}}), changing the keycode ''113'' if necessary to the result gathered by the previous {{codeline|xmodmap}} command:<br />
xmodmap -e "keycode 113 = Super_L" # reassign Alt_R to Super_L<br />
xmodmap -e "remove mod1 = Super_L" # make sure X keeps it out of the mod1 group<br />
<br />
Now, any functions that are triggered by a Super_L (Windows) key press will also be triggered by an Alt_R key press.<br />
<br />
==Resources==<br />
* [http://www.suckless.org/dwm dwm's official website]<br />
* [[dmenu]] - Simple application launcher from the developers of dwm<br />
* The [http://bbs.archlinux.org/viewtopic.php?id=57549/ dwm thread] on the forums<br />
* [http://www.flickr.com/photos/cinderwick/sets/72157604733895131/ dwm wallpapers] and the forums' [http://bbs.archlinux.org/viewtopic.php?id=57768/ wallpaper thread] for a selection of dwm wallpapers<br />
* [http://www.xsnake.net/howto/dwm/dwm-eng.php HowTo by Snake]<br />
* [http://0x80.org/blog/?p=72 Moved to dwm]<br />
* [http://milesgroman.com/articles/configuring-dwm configuring dwm]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Dwm&diff=90737Dwm2010-01-02T19:43:38Z<p>Pwd: /* Basic statusbar */ rm shebang</p>
<hr />
<div>[[Category:Desktop environments (English)]] [[Category:HOWTOs (English)]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Information on installing dwm and increasing its potential}}<br />
{{Article summary heading|Language}}<br />
{{i18n_entry|English|dwm}}<br />
{{i18n_entry|Русский|Dwm (Русский)}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|dmenu}}<br />
{{Article summary wiki|wmii}}<br />
{{Article summary end}}<br />
{{DISPLAYTITLE:dwm}}<br />
[http://dwm.suckless.org/ dwm] is a dynamic window manager for [[X]]. It manages windows in tiled, stacked, and full-screen layouts, as well as many others with the help of optional patches. Layouts can be applied dynamically, optimizing the environment for the application in use and the task performed. dwm is extremely lightweight and fast, written in C and with a stated design goal of remaining under 2000 source lines of code. It provides multi-head support for xrandr and Xinerama.<br />
<br />
==Installing==<br />
These instructions will install dwm using [[makepkg]] along with the Arch Build System, or [[ABS]] for short. This will allow reconfiguring it at a later time without complications. If only interested in installing dwm for a test drive, simply install the binary package from the repositories instead:<br />
# pacman -S dwm<br />
<br />
Note that by omitting compiling dwm from source a great deal of customizability is lost, since dwm's entire configuration is performed by editing its source code. Taking this in mind, the rest of the article assumes that dwm has been compiled from source as explained in the entirety of this section.<br />
<br />
===Requirements===<br />
Basic programming tools present in {{package Official|base-devel}} are needed in order to compile dwm and build a package for it, and the {{package Official|abs}} package is also a requisite for fetching the necessary build scripts:<br />
# pacman -S base-devel abs<br />
<br />
===Download build scripts with ABS===<br />
Once the required packages are installed, use ABS to fetch the latest build scripts from the repositories:<br />
# abs<br />
<br />
Lastly, copy the dwm build scripts from the ABS tree to a temporary directory. For example:<br />
$ cp -r /var/abs/community/dwm ~/dwm<br />
<br />
===Build and install package===<br />
Use {{Codeline|cd}} by switching to the directory containing the build scripts (the example above used {{Filename|~/dwm}}). Then run:<br />
$ makepkg -i<br />
<br />
This will compile dwm, build an Arch Linux package containing the resulting files, and install the package file all in one step. If problems are encountered, review the output for specific information. <br />
<br />
{{Tip|If this directory ({{filename|~/dwm}}) is saved, it can be posteriorly used for making changes to the default configuration.}}<br />
<br />
==Configuring==<br />
dwm, as mentioned before, is exclusively configured at compile-time via some of its source files, namely {{Filename|config.h}} and {{Filename|config.mk}}. While the initial configuration provides a good set of defaults, it's realistic to expect that at some point potential users will probably want to make adjustments to their setups.<br />
<br />
===Method 1: ABS rebuild (recommended)===<br />
Modifying dwm is quite simple using this route.<br />
<br />
====Customizing config.h====<br />
Browse to the dwm source code directory saved during the [[#Installing|installation process]]; {{filename|~/dwm}} in the example. The {{filename|config.h}} found within this directory is where the general dwm preferences are stored. Most settings within the file should be self-explanatory, while others may not share the same trait. For detailed information on these settings, see the [http://www.suckless.org/dwm/ dwm website].<br />
<br />
{{note|Be sure to make a backup copy of config.h before modifying it, just in case something goes wrong.}}<br />
<br />
Once changes have been made, pipe the new md5sums into the [[PKGBUILD]]:<br />
$ makepkg -g >> PKGBUILD<br />
This will eliminate a checksum mismatch between the official config.h and the new revised copy.<br />
<br />
Now, compile and reinstall:<br />
$ makepkg -efi<br />
<br />
Assuming the configuration changes were valid, this command will compile dwm, build and reinstall the resulting package. If problems were encountered, review the output for specific information.<br />
<br />
Finally, restart dwm in order to apply the changes.<br />
<br />
====Notes====<br />
From now on, instead of updating the md5sums for every {{filename|config.h}} revision, which are known to become frequent, one may erase the md5sums array and build dwm with the {{codeline|--skipinteg}} option:<br />
$ makepkg -efi --skipinteg<br />
<br />
And after adding a few lines to dwm's start-up script, it is possible to [[#Restart dwm without logging out or closing programs|restart dwm without logging out or closing programs]].<br />
<br />
===Method 2: Mercurial (advanced)===<br />
dwm is maintained upstream within a [http://www.selenic.com/mercurial/wiki/ Mercurial] version control system. If already familiar with Mercurial, then maintaining configurations and patches within this system may be more convenient. A [http://www.suckless.org/dwm/customisation/patch_queue.html detailed tutorial] on this method is available at the dwm website.<br />
<br />
Before building dwm from the Mercurial sources, be sure to alter config.mk accordingly, because failure to do so may result in X crashes. Here are the values that need changing:<br />
<br />
Modify {{codeline|PREFIX}}:<br />
PREFIX = /usr<br />
The X11 include folder:<br />
X11INC = /usr/include/X11<br />
And the the X11 lib directory:<br />
X11LIB = /usr/lib/X11<br />
<br />
==Starting dwm==<br />
To start dwm with {{Codeline|startx}} or the [[SLIM]] login manager, simply append the following to {{Filename|~/.xinitrc}}: <br />
exec dwm<br />
<br />
For [[GDM]], add it to {{Filename|~/.Xclients}} instead, and select "Run XClient Script" from the Sessions menu.<br />
<br />
==Statusbar configuration==<br />
dwm uses {{Codeline|xsetroot -name}} to display information in its statusbar.<br />
<br />
===Basic statusbar===<br />
This example prints the date in [http://en.wikipedia.org/wiki/ISO_8601 ISO 8601] format. Add it to files {{filename|~/.xinitrc}} or {{filename|~/.Xclients}}:<br />
<pre><br />
while true<br />
do<br />
xsetroot -name "$( date +"%F %R" )"<br />
sleep 1m # Update time every minute<br />
done &<br />
exec dwm<br />
</pre><br />
<br />
Here is an example intended for laptops that depends on the {{Package Official|acpi}} package for showing battery information:<br />
<pre><br />
while true <br />
do<br />
xsetroot -name "$( acpi -b | awk '{ print $3, $4 }' | tr -d ',' )"<br />
done &<br />
exec dwm<br />
</pre><br />
<br />
The script displays the amount of battery remaining and its charging status by using the awk command to trim away the unneeded text from acpi, and tr to remove the commas.<br />
<br />
An alternative to the above is to selectively show the battery status depending on the current charging state:<br />
<pre><br />
while true; do<br />
batt_main="$( LC_ALL=C acpi -b )"<br />
<br />
case "$batt_main" in<br />
*Discharging*)<br />
batt_main="${batt_main#* * * }"<br />
batt_main="${batt_main%%? *} "<br />
;;<br />
*)<br />
batt_main=''<br />
;;<br />
esac<br />
<br />
xsetroot -name "$batt_main$( date +"%R" )"<br />
sleep 1m<br />
done &<br />
</pre><br />
<br />
Finally, make sure there is only one instance of dwm in {{filename|~/.xinitrc}} or {{filename|~/.Xclients}}. So combining everything together should resemble this:<br />
~/.setbg<br />
autocutsel&<br />
termirssi&<br />
urxvt&<br />
while true<br />
do<br />
xsetroot -name "$(date +"%F %R")"<br />
sleep 1m # Update time every minute<br />
done &<br />
'''exec dwm'''<br />
<br />
===Conky statusbar===<br />
Available from the [[AUR]], {{package AUR|conky-cli}} is a special build of conky which prints to <tt>stdout</tt>. If already accustomed to [[conky]], a statusbar rich with information can be ready within minutes. Once conky has been configured to preference, simply print it to the statusbar via the {{Codeline|xsetroot -name}} argument:<br />
conky | while true; read line; do xsetroot -name "$line"; done &<br />
exec dwm<br />
<br />
The following is a sample conkyrc for a dual core CPU, displaying several stats:<br />
<pre><br />
background no<br />
out_to_console yes<br />
update_interval 2<br />
total_run_times 0<br />
use_spacer none<br />
<br />
TEXT<br />
$mpd_smart :: ${cpu cpu1}% / ${cpu cpu2}% ${loadavg 1} ${loadavg 2 3} :: ${acpitemp}c :: $memperc% ($mem) :: ${downspeed eth0}K/s ${upspeed eth0}K/s :: ${time %a %b %d %I:%M%P}<br />
</pre><br />
<br />
==Extended usage==<br />
<br />
===Patches & additional tiling modes===<br />
The official website is full of [http://www.suckless.org/dwm/patches patches] that can add extra functionality to dwm. Users can easily customize dwm by applying the modifications they like. The [http://www.suckless.org/dwm/patches/bottom_stack.html Bottom Stack] patch provides an additional tiling mode that splits the screen horizontally, as opposed to the default vertically oriented tiling mode.<br />
<br />
===Fixing gaps around terminal windows===<br />
If there are empty gaps of desktop space outside terminal windows, it is likely due to the terminal's font size. Either adjust the size until finding the ideal scale that closes the gap, or toggle {{Codeline|resizehints}} to ''False'' in {{filename|config.h}}:<br />
static Bool resizehints = False; /* False means respect size hints in tiled resizals */<br />
<br />
This will cause dwm to ignore resize requests from all client windows, not just terminals. The downside to this workaround is that some terminals may suffer redraw anomalies, such as ghost lines and premature line wraps, among others.<br />
<br />
====Urxvt====<br />
Another choice for [[urxvt]] users is applying the [[urxvt#Fix maximized window gaps|hints patch]] and regressing to dwm's original behaviour:<br />
static Bool resizehints = '''True''';<br />
<br />
===Restart dwm without logging out or closing programs===<br />
For restarting dwm without logging out or closing applications, change or add a startup script so that it loads dwm in a ''while'' loop, like this:<br />
<pre><br />
conky | while read line; do<br />
xsetroot -name "$line"<br />
done | while true; do<br />
# Log stderror to a file <br />
dwm 2> ~/.dwm.log; done<br />
# No error logging<br />
#dwm > /dev/null; done<br />
</pre><br />
<br />
dwm can now be restarted without destroying other X windows by pressing the usual Mod-Shift-Q combination.<br />
<br />
It's a good idea to place the above startup script into a separate file, {{Filename|~/bin/startdwm}} for instance, and execute it through {{filename|~/.xinitrc}}. From this point on, when desiring to actually end the X session simply execute {{Codeline|killall startdwm}}, or bind it to a convenient key.<br />
<br />
===Make the right Alt key work as if it were Mod4 (Windows Key)===<br />
When using Mod4 (aka Super/Windows Key) as the {{codeline|MODKEY}}, it may be equally convenient to have the right Alt key (Alt_R) act as Mod4. This will allow performing otherwise awkward keystrokes one-handed, such as zooming with Alt_R+Enter. <br />
<br />
First, find out which keycode is assigned to Alt_R:<br />
xmodmap -pke | grep Alt_R<br />
<br />
Then simply add the following to the startup script (e.g. {{filename|~/.xinitrc}}), changing the keycode ''113'' if necessary to the result gathered by the previous {{codeline|xmodmap}} command:<br />
xmodmap -e "keycode 113 = Super_L" # reassign Alt_R to Super_L<br />
xmodmap -e "remove mod1 = Super_L" # make sure X keeps it out of the mod1 group<br />
<br />
Now, any functions that are triggered by a Super_L (Windows) key press will also be triggered by an Alt_R key press.<br />
<br />
==Resources==<br />
* [http://www.suckless.org/dwm dwm's official website]<br />
* [[dmenu]] - Simple application launcher from the developers of dwm<br />
* The [http://bbs.archlinux.org/viewtopic.php?id=57549/ dwm thread] on the forums<br />
* [http://www.flickr.com/photos/cinderwick/sets/72157604733895131/ dwm wallpapers] and the forums' [http://bbs.archlinux.org/viewtopic.php?id=57768/ wallpaper thread] for a selection of dwm wallpapers<br />
* [http://www.xsnake.net/howto/dwm/dwm-eng.php HowTo by Snake]<br />
* [http://0x80.org/blog/?p=72 Moved to dwm]<br />
* [http://milesgroman.com/articles/configuring-dwm configuring dwm]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Dwm&diff=90736Dwm2010-01-02T19:31:07Z<p>Pwd: /* Basic statusbar */ simplify script</p>
<hr />
<div>[[Category:Desktop environments (English)]] [[Category:HOWTOs (English)]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Information on installing dwm and increasing its potential}}<br />
{{Article summary heading|Language}}<br />
{{i18n_entry|English|dwm}}<br />
{{i18n_entry|Русский|Dwm (Русский)}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|dmenu}}<br />
{{Article summary wiki|wmii}}<br />
{{Article summary end}}<br />
{{DISPLAYTITLE:dwm}}<br />
[http://dwm.suckless.org/ dwm] is a dynamic window manager for [[X]]. It manages windows in tiled, stacked, and full-screen layouts, as well as many others with the help of optional patches. Layouts can be applied dynamically, optimizing the environment for the application in use and the task performed. dwm is extremely lightweight and fast, written in C and with a stated design goal of remaining under 2000 source lines of code. It provides multi-head support for xrandr and Xinerama.<br />
<br />
==Installing==<br />
These instructions will install dwm using [[makepkg]] along with the Arch Build System, or [[ABS]] for short. This will allow reconfiguring it at a later time without complications. If only interested in installing dwm for a test drive, simply install the binary package from the repositories instead:<br />
# pacman -S dwm<br />
<br />
Note that by omitting compiling dwm from source a great deal of customizability is lost, since dwm's entire configuration is performed by editing its source code. Taking this in mind, the rest of the article assumes that dwm has been compiled from source as explained in the entirety of this section.<br />
<br />
===Requirements===<br />
Basic programming tools present in {{package Official|base-devel}} are needed in order to compile dwm and build a package for it, and the {{package Official|abs}} package is also a requisite for fetching the necessary build scripts:<br />
# pacman -S base-devel abs<br />
<br />
===Download build scripts with ABS===<br />
Once the required packages are installed, use ABS to fetch the latest build scripts from the repositories:<br />
# abs<br />
<br />
Lastly, copy the dwm build scripts from the ABS tree to a temporary directory. For example:<br />
$ cp -r /var/abs/community/dwm ~/dwm<br />
<br />
===Build and install package===<br />
Use {{Codeline|cd}} by switching to the directory containing the build scripts (the example above used {{Filename|~/dwm}}). Then run:<br />
$ makepkg -i<br />
<br />
This will compile dwm, build an Arch Linux package containing the resulting files, and install the package file all in one step. If problems are encountered, review the output for specific information. <br />
<br />
{{Tip|If this directory ({{filename|~/dwm}}) is saved, it can be posteriorly used for making changes to the default configuration.}}<br />
<br />
==Configuring==<br />
dwm, as mentioned before, is exclusively configured at compile-time via some of its source files, namely {{Filename|config.h}} and {{Filename|config.mk}}. While the initial configuration provides a good set of defaults, it's realistic to expect that at some point potential users will probably want to make adjustments to their setups.<br />
<br />
===Method 1: ABS rebuild (recommended)===<br />
Modifying dwm is quite simple using this route.<br />
<br />
====Customizing config.h====<br />
Browse to the dwm source code directory saved during the [[#Installing|installation process]]; {{filename|~/dwm}} in the example. The {{filename|config.h}} found within this directory is where the general dwm preferences are stored. Most settings within the file should be self-explanatory, while others may not share the same trait. For detailed information on these settings, see the [http://www.suckless.org/dwm/ dwm website].<br />
<br />
{{note|Be sure to make a backup copy of config.h before modifying it, just in case something goes wrong.}}<br />
<br />
Once changes have been made, pipe the new md5sums into the [[PKGBUILD]]:<br />
$ makepkg -g >> PKGBUILD<br />
This will eliminate a checksum mismatch between the official config.h and the new revised copy.<br />
<br />
Now, compile and reinstall:<br />
$ makepkg -efi<br />
<br />
Assuming the configuration changes were valid, this command will compile dwm, build and reinstall the resulting package. If problems were encountered, review the output for specific information.<br />
<br />
Finally, restart dwm in order to apply the changes.<br />
<br />
====Notes====<br />
From now on, instead of updating the md5sums for every {{filename|config.h}} revision, which are known to become frequent, one may erase the md5sums array and build dwm with the {{codeline|--skipinteg}} option:<br />
$ makepkg -efi --skipinteg<br />
<br />
And after adding a few lines to dwm's start-up script, it is possible to [[#Restart dwm without logging out or closing programs|restart dwm without logging out or closing programs]].<br />
<br />
===Method 2: Mercurial (advanced)===<br />
dwm is maintained upstream within a [http://www.selenic.com/mercurial/wiki/ Mercurial] version control system. If already familiar with Mercurial, then maintaining configurations and patches within this system may be more convenient. A [http://www.suckless.org/dwm/customisation/patch_queue.html detailed tutorial] on this method is available at the dwm website.<br />
<br />
Before building dwm from the Mercurial sources, be sure to alter config.mk accordingly, because failure to do so may result in X crashes. Here are the values that need changing:<br />
<br />
Modify {{codeline|PREFIX}}:<br />
PREFIX = /usr<br />
The X11 include folder:<br />
X11INC = /usr/include/X11<br />
And the the X11 lib directory:<br />
X11LIB = /usr/lib/X11<br />
<br />
==Starting dwm==<br />
To start dwm with {{Codeline|startx}} or the [[SLIM]] login manager, simply append the following to {{Filename|~/.xinitrc}}: <br />
exec dwm<br />
<br />
For [[GDM]], add it to {{Filename|~/.Xclients}} instead, and select "Run XClient Script" from the Sessions menu.<br />
<br />
==Statusbar configuration==<br />
dwm uses {{Codeline|xsetroot -name}} to display information in its statusbar.<br />
<br />
===Basic statusbar===<br />
This example prints the date in [http://en.wikipedia.org/wiki/ISO_8601 ISO 8601] format. Add it to files {{filename|~/.xinitrc}} or {{filename|~/.Xclients}}:<br />
<pre><br />
while true<br />
do<br />
xsetroot -name "$( date +"%F %R" )"<br />
sleep 1m # Update time every minute<br />
done &<br />
exec dwm<br />
</pre><br />
<br />
Here is an example intended for laptops that depends on the {{Package Official|acpi}} package for showing battery information:<br />
<pre><br />
while true <br />
do<br />
xsetroot -name "$( acpi -b | awk '{ print $3, $4 }' | tr -d ',' )"<br />
done &<br />
exec dwm<br />
</pre><br />
<br />
The script displays the amount of battery remaining and its charging status by using the awk command to trim away the unneeded text from acpi, and tr to remove the commas.<br />
<br />
An alternative to the above is to selectively show the battery status depending on the current charging state:<br />
<pre><br />
#!/bin/sh<br />
while true; do<br />
batt_main="$( LC_ALL=C acpi -b )"<br />
<br />
case "$batt_main" in<br />
*Discharging*)<br />
batt_main="${batt_main#* * * }"<br />
batt_main="${batt_main%%? *} "<br />
;;<br />
*)<br />
batt_main=''<br />
;;<br />
esac<br />
<br />
xsetroot -name "$batt_main$( date +"%R" )"<br />
sleep 1m<br />
done &<br />
</pre><br />
<br />
Finally, make sure there is only one instance of dwm in {{filename|~/.xinitrc}} or {{filename|~/.Xclients}}. So combining everything together should resemble this:<br />
~/.setbg<br />
autocutsel&<br />
termirssi&<br />
urxvt&<br />
while true<br />
do<br />
xsetroot -name "$(date +"%F %R")"<br />
sleep 1m # Update time every minute<br />
done &<br />
'''exec dwm'''<br />
<br />
===Conky statusbar===<br />
Available from the [[AUR]], {{package AUR|conky-cli}} is a special build of conky which prints to <tt>stdout</tt>. If already accustomed to [[conky]], a statusbar rich with information can be ready within minutes. Once conky has been configured to preference, simply print it to the statusbar via the {{Codeline|xsetroot -name}} argument:<br />
conky | while true; read line; do xsetroot -name "$line"; done &<br />
exec dwm<br />
<br />
The following is a sample conkyrc for a dual core CPU, displaying several stats:<br />
<pre><br />
background no<br />
out_to_console yes<br />
update_interval 2<br />
total_run_times 0<br />
use_spacer none<br />
<br />
TEXT<br />
$mpd_smart :: ${cpu cpu1}% / ${cpu cpu2}% ${loadavg 1} ${loadavg 2 3} :: ${acpitemp}c :: $memperc% ($mem) :: ${downspeed eth0}K/s ${upspeed eth0}K/s :: ${time %a %b %d %I:%M%P}<br />
</pre><br />
<br />
==Extended usage==<br />
<br />
===Patches & additional tiling modes===<br />
The official website is full of [http://www.suckless.org/dwm/patches patches] that can add extra functionality to dwm. Users can easily customize dwm by applying the modifications they like. The [http://www.suckless.org/dwm/patches/bottom_stack.html Bottom Stack] patch provides an additional tiling mode that splits the screen horizontally, as opposed to the default vertically oriented tiling mode.<br />
<br />
===Fixing gaps around terminal windows===<br />
If there are empty gaps of desktop space outside terminal windows, it is likely due to the terminal's font size. Either adjust the size until finding the ideal scale that closes the gap, or toggle {{Codeline|resizehints}} to ''False'' in {{filename|config.h}}:<br />
static Bool resizehints = False; /* False means respect size hints in tiled resizals */<br />
<br />
This will cause dwm to ignore resize requests from all client windows, not just terminals. The downside to this workaround is that some terminals may suffer redraw anomalies, such as ghost lines and premature line wraps, among others.<br />
<br />
====Urxvt====<br />
Another choice for [[urxvt]] users is applying the [[urxvt#Fix maximized window gaps|hints patch]] and regressing to dwm's original behaviour:<br />
static Bool resizehints = '''True''';<br />
<br />
===Restart dwm without logging out or closing programs===<br />
For restarting dwm without logging out or closing applications, change or add a startup script so that it loads dwm in a ''while'' loop, like this:<br />
<pre><br />
conky | while read line; do<br />
xsetroot -name "$line"<br />
done | while true; do<br />
# Log stderror to a file <br />
dwm 2> ~/.dwm.log; done<br />
# No error logging<br />
#dwm > /dev/null; done<br />
</pre><br />
<br />
dwm can now be restarted without destroying other X windows by pressing the usual Mod-Shift-Q combination.<br />
<br />
It's a good idea to place the above startup script into a separate file, {{Filename|~/bin/startdwm}} for instance, and execute it through {{filename|~/.xinitrc}}. From this point on, when desiring to actually end the X session simply execute {{Codeline|killall startdwm}}, or bind it to a convenient key.<br />
<br />
===Make the right Alt key work as if it were Mod4 (Windows Key)===<br />
When using Mod4 (aka Super/Windows Key) as the {{codeline|MODKEY}}, it may be equally convenient to have the right Alt key (Alt_R) act as Mod4. This will allow performing otherwise awkward keystrokes one-handed, such as zooming with Alt_R+Enter. <br />
<br />
First, find out which keycode is assigned to Alt_R:<br />
xmodmap -pke | grep Alt_R<br />
<br />
Then simply add the following to the startup script (e.g. {{filename|~/.xinitrc}}), changing the keycode ''113'' if necessary to the result gathered by the previous {{codeline|xmodmap}} command:<br />
xmodmap -e "keycode 113 = Super_L" # reassign Alt_R to Super_L<br />
xmodmap -e "remove mod1 = Super_L" # make sure X keeps it out of the mod1 group<br />
<br />
Now, any functions that are triggered by a Super_L (Windows) key press will also be triggered by an Alt_R key press.<br />
<br />
==Resources==<br />
* [http://www.suckless.org/dwm dwm's official website]<br />
* [[dmenu]] - Simple application launcher from the developers of dwm<br />
* The [http://bbs.archlinux.org/viewtopic.php?id=57549/ dwm thread] on the forums<br />
* [http://www.flickr.com/photos/cinderwick/sets/72157604733895131/ dwm wallpapers] and the forums' [http://bbs.archlinux.org/viewtopic.php?id=57768/ wallpaper thread] for a selection of dwm wallpapers<br />
* [http://www.xsnake.net/howto/dwm/dwm-eng.php HowTo by Snake]<br />
* [http://0x80.org/blog/?p=72 Moved to dwm]<br />
* [http://milesgroman.com/articles/configuring-dwm configuring dwm]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Display_manager&diff=90631Display manager2010-01-01T20:53:41Z<p>Pwd: /* Installation */ clar on arch theme pkg</p>
<hr />
<div>[[Category:Boot process (English)]]<br />
[[Category:Display managers (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers installation, configuration, and troubleshooting of common display managers.}}<br />
{{Article summary heading|Available in languages}}<br />
{{i18n entry|Česky|Adding a login manager (KDM, GDM, or XDM) to automatically boot on startup (Česky)}}<br />
{{i18n entry|English|Display Manager}}<br />
{{i18n entry|Italiano|Avviare automaticamente un gestore login grafico all'avvio}}<br />
{{i18n entry|Español|Agregando un Administrador de sesión (KDM, GDM, ó XDM) (Español)}}<br />
{{i18n entry|Deutsch|Einen Anmeldungsmanager hinzufügen (KDM, GDM, oder XDM), der sich automatisch beim Systemstart öffnet (Deutsch)}}<br />
{{i18n entry|עברית|הוסף מנהל התחברות גרפי (KDM, GDM או XDM) להפעלה אוטומטית לאחר האתחול}}<br />
{{i18n entry|Русский|Добавление экранного менеджера входа в систему (KDM, GDM или XDM) в автозагрузку}}<br />
{{i18n entry|简体中文|在启动时自动启动一个登录管理器(KDM, GDM, or XDM)}}<br />
{{i18n entry|Türkçe|Açılışta Giriş Yöneticisi Çalıştırmak}}<br />
{{Article summary heading|Related articles}}<br />
{{Article summary wiki|Xorg}}<br />
{{Article summary wiki|Start X at boot}}<br />
{{Article summary end}}<br />
<br />
A [[Wikipedia:X display manager (program type)|display manager]], or login manager, is a graphical interface screen that is displayed at the end of the boot process in place of the default shell. There are various types of display managers, just as there are various types of window and desktop managers. There is usually a certain amount of customization and themeability available with these managers.<br />
<br />
==Installation==<br />
Choose and install a preferred display manager:<br />
<br />
{{Note|It is best practice, but not required, to choose the display manager that corresponds to your desktop environment. Typically [[SLiM]] is preferred if there is not a corresponding desktop environment.}}<br />
<br />
'''XDM:''' X display manager<br />
# pacman -Sy xorg-xdm<br />
<br />
'''GDM:''' Gnome display manager<br />
# pacman -Sy gdm<br />
<br />
'''[[KDM]]:''' KDE display manager<br />
# pacman -Sy kdebase kdebase-workspace<br />
<br />
'''[[SLiM]]:''' Simple Login Manager<br />
# pacman -Sy slim<br />
<br />
'''[[Qingy]]:''' DirectFB getty replacement (the Arch theme package is optional)<br />
# pacman -Sy qingy qingy-theme-arch<br />
<br />
'''Entrance:''' Enlightenment display manager<br />
# pacman -Sy entrance-svn<br />
<br />
'''[[CDM]]:''' Console Display Manager<br />
A package is available in the AUR: {{Package AUR|cdm}}<br />
<br />
==Loading the display manager==<br />
You have two easy methods to make the system load the display manager:<br />
<br />
; {{Filename|inittab}} method : The display manager will load automatically after start-up and will respawn in the event of a crash.<br />
; [[Daemon]] method : The display manager will load automatically during the start-up as a daemon (currently only works with Entrance, GDM, KDM and SLiM).<br />
<br />
The {{Filename|inittab}} method is recommended for various reasons, one being that it will allow you to boot directly into framebuffer mode from [[GRUB]]. This is an advantage should the graphics driver crash in X, for example, you would not be forced to fix your system from a live CD or through other needlessly complex means.<br />
<br />
With the {{Filename|inittab}} method all you would have to do is to press 'e' for edit at the GRUB prompt and just add the number of the run-level you prefer, such as run-level '''3''', to the end of the 'kernel' line to boot directly into framebuffer mode in order to fix your system/X (this described in detail below.)<br />
<br />
When using the daemon method you can simply boot into runlevel '''1/S''' which will prevent any daemons, including the login manager, from being started. Then you can fix your system/X and switch into the runlevel '''3'''. Both methods are equally easy. <!-- Then why is inittab recommended?! --><br />
<br />
==={{Filename|inittab}} method (recommended)===<br />
The run-levels are:<br />
0 Halt<br />
1(S) Single-user<br />
2 Not used<br />
3 Multi-user (default)<br />
4 Not used<br />
5 X11<br />
6 Reboot<br />
<br />
====Modify default run-level====<br />
Edit {{Filename|/etc/inittab}} and find the line that looks like this:<br />
id:3:initdefault:<br />
<br />
Modify the '3' to '5' for X11:<br />
id:5:initdefault:<br />
<br />
The next time you reboot, the 'X display manager' should run. For other display managers see below:<br />
<br />
====Modify default display manager====<br />
Edit {{Filename|/etc/inittab}} and find the line that looks like similar to this one (near the end):<br />
x:5:respawn:/usr/bin/xdm -nodaemon<br />
<br />
Modify it so it points to the display manager of your choice:<br />
<br />
'''GDM:'''<br />
x:5:respawn:/usr/sbin/gdm -nodaemon<br />
<br />
'''KDM:'''<br />
x:5:respawn:/usr/bin/kdm -nodaemon<br />
<br />
'''SLiM:'''<br />
x:5:respawn:/usr/bin/slim >& /dev/null<br />
<br />
'''Entrance:'''<br />
x:5:respawn:/usr/sbin/entranced --nodaemon &> /dev/null<br />
<br />
The next time you reboot, the display manager of your choice should run.<br />
<br />
===Daemon method===<br />
You simply need to add the daemon name to your daemons array in {{Filename|/etc/rc.conf}}<br />
<br />
Near the end of the file you will see a line that looks similar to the following:<br />
DAEMONS=(syslogd klogd !pcmcia network netfs crond) # this is the daemons array<br />
<br />
Append the daemon name for the display manager of your choice ({{Codeline|entranced}}, {{Codeline|gdm}}, {{Codeline|kdm}}, or {{Codeline|slim}}):<br />
DAEMONS=(syslogd klogd !pcmcia network netfs crond '''entranced''')<br />
<br />
Ensure you start the display manager '''last''' in the DAEMONS array, otherwise X will later allocate a tty device which was previously claimed by getty (see {{Filename|/etc/inittab}}). Not placing the display manager at the end can cause X crashes, and is therefore unsupported.<br />
<br />
The next time you reboot, the display manager should run. In the event that it does not, be certain that you typed in the name correctly, and that the manager you selected is installed. It also helps to ensure that {{Codeline|startx}} is not stopping with errors.<br />
<br />
{{Note|If you use this method and your display manager hangs while loading, or X does not recognize any input device, you will need to boot into single user mode (run-level 1) using the examples above and remove the display manager daemon from {{Filename|rc.conf}}.}}<br />
<br />
==Troubleshooting==<br />
<br />
===Switching run-levels===<br />
<br />
====Command prompt====<br />
If you want to test out the display manager without rebooting, or you want to change the X configuration and that pesky display manager keeps respawning, use this command:<br />
/sbin/telinit <run-level><br />
<br />
To switch to run-level 3 (Multi-user):<br />
/sbin/telinit 3<br />
<br />
To switch to run-level 5 (X11):<br />
/sbin/telinit 5<br />
<br />
By switching you can avoid restarting the system during your testing.<br />
<br />
====GRUB====<br />
You can add a menu item in [[GRUB]] to allow you to boot with or without X11,<br />
<br />
In {{Filename|/boot/grub/menu.lst}} find the first kernel entry you have (the default is '# (0) Arch Linux')<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/sda3 ro<br />
initrd /kernel26.img<br />
<br />
You can duplicate it and modify both like so:<br />
# (0) Arch Linux Multi-user<br />
title Arch Linux Multi-user<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/sda3 ro '''3'''<br />
initrd /kernel26.img<br />
<br />
# (1) Arch Linux X11<br />
title Arch Linux X11<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/sda3 ro '''5'''<br />
initrd /kernel26.img<br />
<br />
The run-level was appended to the end so the kernel knows what run-level to start with.<br />
<br />
====LILO====<br />
You can start-up with the run-level of your choice by just selecting or typing in the kernel name and then appending the desired run-level in the [[LILO]] boot screen like so:<br />
: Arch 5<br />
<br />
===GDM fails on logout===<br />
<br />
If GDM starts up properly on boot, but fails after repeated attempts on logout, try adding this line to the daemon section of {{Filename|/etc/gdm/custom.conf}}:<br />
GdmXserverTimeout=60<br />
<br />
===GDM root login===<br />
It is not advised to login as root, but if necessary you can edit {{Filename|/etc/gdm/custom.conf}} and add:<br />
[security]<br />
AllowRoot=true<br />
<br />
You should be able to login as root after restarting GDM.</div>Pwdhttps://wiki.archlinux.org/index.php?title=Qingy&diff=90630Qingy2010-01-01T20:51:13Z<p>Pwd: skip intro header</p>
<hr />
<div>[[Category:Boot process (English)]]<br />
[[Category:Display managers (English)]]<br />
[[Category:Eye candy (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Qingy}}<br />
{{i18n_entry|Türkçe|Qingy (Türkçe)}}<br />
{{i18n_links_end}}<br />
[http://qingy.sourceforge.net/ Qingy] is a replacement for getty and login-managers like slim, kdm gdm and so on, using [http://www.directfb.org DirectFB] to provide a fast, nice GUI without the overhead of the X Window System. It allows users to log in and start the session of their choice (text console, gnome, kde, wmaker, etc.). Running several X sessions is also possible.<br />
<br />
==How to get qingy?==<br />
First you need a working DirectFB.<br />
I'm recommending [http://wiki.archlinux.org/index.php/Uvesafb Uvesafb] but if you have some graphical issues with it use vesafb. Qingy does not work with KMS.<br />
<br />
A package is available in the [community] repo. To install:<br />
# pacman -S qingy <br />
<br />
Several extra themes are also available. In [community] repo, there is an Arch specific theme:<br />
# pacman -S qingy-theme-arch<br />
<br />
A package of several various themes is available in AUR:<br />
<br />
*[http://aur.archlinux.org/packages.php?do_Details=1&ID=5501 qingy-themes]<br />
<br />
==Replace *getty with qingy==<br />
To use qingy, you'll need to edit /etc/inittab.<br />
<br />
Replace:<br />
c1:2345:respawn:/sbin/agetty -8 38400 vc/1 linux<br />
c2:2345:respawn:/sbin/agetty -8 38400 vc/2 linux<br />
c3:2345:respawn:/sbin/agetty -8 38400 vc/3 linux<br />
c4:2345:respawn:/sbin/agetty -8 38400 vc/4 linux<br />
c5:2345:respawn:/sbin/agetty -8 38400 vc/5 linux<br />
c6:2345:respawn:/sbin/agetty -8 38400 vc/6 linux<br />
<br />
by:<br />
c1:2345:respawn:/sbin/qingy tty1<br />
c2:2345:respawn:/sbin/qingy tty2<br />
c3:2345:respawn:/sbin/qingy tty3<br />
c4:2345:respawn:/sbin/qingy tty4<br />
c5:2345:respawn:/sbin/qingy tty5<br />
c6:2345:respawn:/sbin/agetty -8 38400 vc/6 linux<br />
<br />
Qingy's author suggest to keep agetty on a console (here on console 6) as a safety measure as qingy is still beta software.<br />
<br />
Because qingy uses tty0-9 insead of vc/1-6 so you need add tty to /etc/securetty (NOTE : this should no longer be necessary since vc/1-6 have been replaced by tty0-9 with the new version of agetty): <br />
#<br />
# /etc/securetty<br />
#<br />
console<br />
vc/1<br />
vc/2<br />
vc/3<br />
vc/4<br />
vc/5<br />
vc/6<br />
tty0<br />
tty1<br />
tty2<br />
tty3<br />
tty4<br />
tty5<br />
tty6<br />
tty7<br />
<br />
==Configuring qingy==<br />
<br />
You can configure qingy by editing /etc/qingy/settings.<br />
<br />
The default settings for X are fine so only edit them if you really know what you are doing.<br />
# Full path to the X server<br />
#x_server = "/usr/bin/Xorg"<br />
# Full path to the 'xinit' executable<br />
xinit = "/usr/bin/xinit"<br />
# Parameter we should pass to the X server<br />
x_args = "-nolisten tcp -br"<br />
<br />
I recommend to set <br />
log_facilities = console, file<br />
so you can look for errors in /var/log/qingy.log, too.<br />
<br />
All other options are well explained.<br />
<br />
==Starting X==<br />
<br />
Please do note that .xinitrc is different from .xsession. The default login script, .xinitrc, works with startx, but graphical login managers generally do not look for .xinitrc. Instead, they look for a file named .xsession in your home directory.<br />
<br />
If you want to start X with qingy you need to edit your .xsession.<br />
<br />
Here a default .xsession for qingy.<br />
#!/bin/sh<br />
exec <login-shell command> <window manager starter><br />
An example:<br />
#!/bin/sh<br />
exec bash --login -c 'openbox-session'<br />
<br />
The start of the window manager using a login shell is needed because qingy starts the X-session directly without the help of a shell.<br />
This causes issues like no umlauts in xterm and malfunction of control keys like "Home", "End", "Del" and so on in the terminal.<br />
<br />
For more details, visit the Ubuntu CustomXSession wiki at [https://wiki.ubuntu.com/CustomXSession]<br />
<br />
==Adding a session entry==<br />
<br />
If you've changed the variable x_sessions or text_session in the config file of qingy replace the following paths with the path you've set.<br />
<br />
===Text mode session===<br />
<br />
Create a file /etc/qingy/sessions/<sessionname>.<br />
<br />
The file name is shown as entry in the session list.<br />
<br />
The file should be a shell script. For an example have a look into /etc/qingy/sessios/emacs.<br />
<br />
===X mode session===<br />
<br />
Create the folder /etc/X11/Sessions/ and save a new script file into it. (see Text mode session)<br />
<br />
The name of the file is shown in the session list.<br />
<br />
==Troubleshooting==<br />
<br />
=== Synaptic touchpad and keyboard issue ===<br />
<br />
Qingy (and quite possibly other DirectFB applicationss) has some issues using Synaptics touchpad. Also the keyboard can behave strangely (like if each keys were pressed twice).<br />
<br />
This can be solved by adding:<br />
disable-module=linux_input<br />
to /etc/directfbrc. If the file does not exist, create it. This will enable you to use your touchpad, however some extra functionality like tapping or tap-dragging might not work.</div>Pwdhttps://wiki.archlinux.org/index.php?title=Tint2&diff=90628Tint22010-01-01T16:18:30Z<p>Pwd: /* Running tint2 */ clar: it doesn't necessarily start it at boot</p>
<hr />
<div>[[Category:Eye candy (English)]] [[Category:HOWTOs (English)]]<br />
[http://code.google.com/p/tint2/ tint2] is a system panel for linux. It is described by its developers as "simple panel/taskbar unobtrusive and light". It can be configured to include (or not include) among other things a system tray, a task list a battery monitor and a clock. Its look can also be configured a great deal, and it does not have many dependencies. This makes it ideal for window manager users who want a panel but don't have one by default, like [[Openbox]] users.<br />
<br />
==Installing==<br />
tint2 is in the community repository. Use [[pacman]] to install it:<br />
# pacman -S tint2<br />
<br />
==Configuring==<br />
tint2 has a configuration file in {{filename|~/.config/tint2/tint2rc}}. A skeleton configuration file with the default settings is created on the first time tint2 is ran. You can then change this file to your liking. Full documentation on how to configure tint2 is found [http://code.google.com/p/tint2/wiki/Configure here]. You can configure the fonts, colors, looks, location and more in this file.<br />
<br />
==Running tint2==<br />
You can run tint2 by simply typing the command:<br />
$ tint2<br />
<br />
If you want to run it on when starting [[X]], simply add this to ~/.xinitrc. For example if you run tint2 with [[openbox]]:<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
'''tint2 &'''<br />
exec ck-launch-session openbox-session</div>Pwdhttps://wiki.archlinux.org/index.php?title=Tint2&diff=90627Tint22010-01-01T16:14:22Z<p>Pwd: sp gr</p>
<hr />
<div>[[Category:Eye candy (English)]] [[Category:HOWTOs (English)]]<br />
[http://code.google.com/p/tint2/ tint2] is a system panel for linux. It is described by its developers as "simple panel/taskbar unobtrusive and light". It can be configured to include (or not include) among other things a system tray, a task list a battery monitor and a clock. Its look can also be configured a great deal, and it does not have many dependencies. This makes it ideal for window manager users who want a panel but don't have one by default, like [[Openbox]] users.<br />
<br />
==Installing==<br />
tint2 is in the community repository. Use [[pacman]] to install it:<br />
# pacman -S tint2<br />
<br />
==Configuring==<br />
tint2 has a configuration file in {{filename|~/.config/tint2/tint2rc}}. A skeleton configuration file with the default settings is created on the first time tint2 is ran. You can then change this file to your liking. Full documentation on how to configure tint2 is found [http://code.google.com/p/tint2/wiki/Configure here]. You can configure the fonts, colors, looks, location and more in this file.<br />
<br />
==Running tint2==<br />
You can run tint2 by simply typing the command:<br />
$ tint2<br />
<br />
If you want to run it on boot, simply add this to ~/.xinitrc. For example if you run tint2 with [[openbox]]:<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
'''tint2 &'''<br />
exec ck-launch-session openbox-session</div>Pwdhttps://wiki.archlinux.org/index.php?title=Tint2&diff=90626Tint22010-01-01T16:12:30Z<p>Pwd: /* Configuring */ sp</p>
<hr />
<div>[[Category:Eye candy (English)]] [[Category:HOWTOs (English)]]<br />
[http://code.google.com/p/tint2/ tint2] is a system panel for linux. It is described by its developers as "simple panel/taskbar unintrusive and light". It can be configured to include (or not include) among other things a system tray, a task list a battery monitor and a clock. Its look can also be configured a great deal, and it does not have many dependecies. This makes it ideal for windown manager users who want a panel but don't have one by default, like [[Openbox]].<br />
<br />
==Installing==<br />
tint2 is in the community repository. Use [[pacman]] to install it:<br />
# pacman -S tint2<br />
<br />
==Configuring==<br />
tint2 has a configuration file in {{filename|~/.config/tint2/tint2rc}}. A skeleton configuration file with the default settings is created on the first time tint2 is ran. You can then change this file to your liking. Full documentation on how to configure tint2 is found [http://code.google.com/p/tint2/wiki/Configure here]. You can configure the fonts, colors, looks, location and more in this file.<br />
<br />
==Running tint2==<br />
You can run tint2 by simply typing the command:<br />
$ tint2<br />
<br />
If you want to run it on boot, simply add this to ~/.xinitrc. For example if you run tint2 with [[openbox]]:<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
'''tint2 &'''<br />
exec ck-launch-session openbox-session</div>Pwdhttps://wiki.archlinux.org/index.php?title=Tint2&diff=90625Tint22010-01-01T16:12:11Z<p>Pwd: /* Installing */ sp and code indent</p>
<hr />
<div>[[Category:Eye candy (English)]] [[Category:HOWTOs (English)]]<br />
[http://code.google.com/p/tint2/ tint2] is a system panel for linux. It is described by its developers as "simple panel/taskbar unintrusive and light". It can be configured to include (or not include) among other things a system tray, a task list a battery monitor and a clock. Its look can also be configured a great deal, and it does not have many dependecies. This makes it ideal for windown manager users who want a panel but don't have one by default, like [[Openbox]].<br />
<br />
==Installing==<br />
tint2 is in the community repository. Use [[pacman]] to install it:<br />
# pacman -S tint2<br />
<br />
==Configuring==<br />
tint2 has a configuration file in {{filename|~/.config/tint2/tint2rc}}. A skelaton configuration file with the default settings is created on the first time tint2 is ran. You can then change this file to your liking. Full documentation on how to configure tint2 is found [http://code.google.com/p/tint2/wiki/Configure here]. You can configure the conts, colors, looks, location and more in this file. <br />
<br />
==Running tint2==<br />
You can run tint2 by simply typing the command:<br />
$ tint2<br />
<br />
If you want to run it on boot, simply add this to ~/.xinitrc. For example if you run tint2 with [[openbox]]:<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
'''tint2 &'''<br />
exec ck-launch-session openbox-session</div>Pwdhttps://wiki.archlinux.org/index.php?title=Tint2&diff=90624Tint22010-01-01T16:11:45Z<p>Pwd: /* Running tint2 */ add ps1 and fx code indent</p>
<hr />
<div>[[Category:Eye candy (English)]] [[Category:HOWTOs (English)]]<br />
[http://code.google.com/p/tint2/ tint2] is a system panel for linux. It is described by its developers as "simple panel/taskbar unintrusive and light". It can be configured to include (or not include) among other things a system tray, a task list a battery monitor and a clock. Its look can also be configured a great deal, and it does not have many dependecies. This makes it ideal for windown manager users who want a panel but don't have one by default, like [[Openbox]].<br />
<br />
==Installing==<br />
tint2 is in the commnity repository. Use [[pacman]] to install it:<br />
# pacman -S tint2<br />
<br />
==Configuring==<br />
tint2 has a configuration file in {{filename|~/.config/tint2/tint2rc}}. A skelaton configuration file with the default settings is created on the first time tint2 is ran. You can then change this file to your liking. Full documentation on how to configure tint2 is found [http://code.google.com/p/tint2/wiki/Configure here]. You can configure the conts, colors, looks, location and more in this file. <br />
<br />
==Running tint2==<br />
You can run tint2 by simply typing the command:<br />
$ tint2<br />
<br />
If you want to run it on boot, simply add this to ~/.xinitrc. For example if you run tint2 with [[openbox]]:<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
'''tint2 &'''<br />
exec ck-launch-session openbox-session</div>Pwdhttps://wiki.archlinux.org/index.php?title=Tint2&diff=90623Tint22010-01-01T16:06:28Z<p>Pwd: move to eye candy cat; sp; heading levels</p>
<hr />
<div>[[Category:Eye candy (English)]] [[Category:HOWTOs (English)]]<br />
[http://code.google.com/p/tint2/ tint2] is a system panel for linux. It is described by its developers as "simple panel/taskbar unintrusive and light". It can be configured to include (or not include) among other things a system tray, a task list a battery monitor and a clock. Its look can also be configured a great deal, and it does not have many dependecies. This makes it ideal for windown manager users who want a panel but don't have one by default, like [[Openbox]].<br />
<br />
==Installing==<br />
tint2 is in the commnity repository. Use [[pacman]] to install it:<br />
# pacman -S tint2<br />
<br />
==Configuring==<br />
tint2 has a configuration file in {{filename|~/.config/tint2/tint2rc}}. A skelaton configuration file with the default settings is created on the first time tint2 is ran. You can then change this file to your liking. Full documentation on how to configure tint2 is found [http://code.google.com/p/tint2/wiki/Configure here]. You can configure the conts, colors, looks, location and more in this file. <br />
<br />
==Running tint2==<br />
You can run tint2 by simply typing the command:<br />
tint2<br />
<br />
If you want to run it on boot, simply add this to ~/.xinitrc. For example if you run tint2 with [[openbox]]:<br />
#!/bin/sh<br />
#<br />
# ~/.xinitrc<br />
#<br />
# Executed by startx (run your window manager from here)<br />
'''tint2 &'''<br />
exec ck-launch-session openbox-session</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba_domain_controller&diff=90620Samba domain controller2010-01-01T16:02:29Z<p>Pwd: moved Samba domain controller to Samba Domain Controller:&#32;casing</p>
<hr />
<div>[[Category:HOWTOs (English)]]<br />
This article explains how to setup a simple Windows Domain Controller with user authentication and shares on a small network using samba. Note this Howto is currently only a rough guide and may not work properly<br />
<br />
=Installation=<br />
<br />
Make sure your Arch is up to date:<br />
<br />
pacman -Syu<br />
<br />
Install Samba,<br />
pacman -Sy samba<br />
<br />
Add a user called administrator and make him in the group wheel<br />
<br />
adduser<br />
<br />
=Configuration=<br />
<br />
Static IP is recommended, but not required.<br />
vi /etc/rc.conf<br />
Change your IP,<br />
eth0="eth0 192.168.0.101 netmask 255.255.255.0 broadcast 192.168.0.255"<br />
Save and exit.<br />
<br />
==PreConfiguration==<br />
<br />
run the following commands to create files and change permissions<br />
<br />
mkdir /home/samba<br />
mkdir /home/samba/netlogon<br />
mkdir /home/samba/profiles<br />
chmod 777 /var/spool/samba/<br />
chown -R root:users /home/samba/<br />
chmod -R 771 /home/samba/<br />
mkdir -p /home/shares/allusers<br />
chown -R root:users /home/shares/allusers/<br />
chmod -R ug+rwx,o+rx-w /home/shares/allusers/<br />
<br />
==Samba Config File==<br />
<br />
Create the samba config file<br />
<br />
vi /etc/samba/smb.conf<br />
<br />
Enter the following text<br />
<br />
[global]<br />
workgroup = MIDEARTH<br />
netbios name = archer<br />
server string = Samba Domain Controller<br />
<br />
<br />
passdb backend = tdbsam<br />
security = user<br />
username map = /etc/samba/smbusers<br />
name resolve order = wins bcast hosts<br />
domain logons = yes<br />
preferred master = yes<br />
wins support = yes<br />
<br />
<br />
# Default logon<br />
logon drive = H:<br />
logon script = scripts/logon.bat<br />
logon path = \\archer\profile\%U<br />
<br />
<br />
# Useradd scripts<br />
add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u<br />
delete user script = /usr/sbin/userdel -r %u<br />
add group script = /usr/sbin/groupadd %g<br />
delete group script = /usr/sbin/groupdel %g<br />
add user to group script = /usr/sbin/usermod -G %g %u<br />
add machine script = /usr/sbin/useradd -s /bin/false/ -d /var/lib/nobody %u<br />
idmap uid = 15000-20000<br />
idmap gid = 15000-20000<br />
template shell = /bin/bash<br />
<br />
<br />
# sync smb passwords with linux passwords<br />
passwd program = /usr/bin/passwd %u<br />
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *password\supdated\ssuccessfully* .<br />
passwd chat debug = yes<br />
unix password sync = yes<br />
<br />
# set the loglevel<br />
log level = 3<br />
<br />
[public]<br />
browseable = yes<br />
public = yes<br />
<br />
<br />
[homes]<br />
comment = Home<br />
valid users = %S<br />
read only = no<br />
browsable = no<br />
<br />
<br />
[netlogon]<br />
comment = Network Logon Service<br />
path = /home/samba/netlogon<br />
admin users = administrator<br />
valid users = %U<br />
read only = no<br />
guest ok = yes<br />
writable = no<br />
share modes = no<br />
<br />
<br />
[profile]<br />
comment = User profiles<br />
path = /home/samba/profiles<br />
valid users = %U<br />
create mode = 0600<br />
directory mode = 0700<br />
writable = yes<br />
browsable = no<br />
guest ok = no<br />
<br />
<br />
[allusers]<br />
comment = All Users<br />
path = /home/shares/allusers<br />
valid users = @users<br />
force group = users <br />
create mask = 0660<br />
directory mask = 0771<br />
writable = yes<br />
<br />
==Other Configuration==<br />
<br />
Next restart samba<br />
<br />
/etc/rc.d/samba restart<br />
<br />
Edit the following file<br />
<br />
vi /etc/nsswitch.conf<br />
<br />
And change the line <br />
<br />
hosts: files dns<br />
<br />
to say<br />
<br />
hosts: files wins dns<br />
<br />
Add the root user to the samba password database<br />
<br />
smbpasswd -a root<br />
<br />
This next command tells the server that the user administrator will be our domain admin<br />
<br />
echo "root = administrator" > /etc/samba/smbusers<br />
<br />
Add the default domain groups ('''SUPER IMPORTANT!''')<br />
<br />
net groupmap add ntgroup="Domain Admins" unixgroup=wheel rid=512 type=d<br />
net groupmap add ntgroup="Domain Users" unixgroup=users rid=513 type=d<br />
net groupmap add ntgroup="Domain Guests" unixgroup=nobody rid=514 type=d<br />
<br />
==Adding users==<br />
<br />
First add the user<br />
<br />
useradd username -m -G users<br />
<br />
then add it to the samba database<br />
<br />
smbpasswd -a username<br />
<br />
Restart the samba server just to be sure<br />
<br />
/etc/rc.d/samba restart<br />
<br />
=Finished=<br />
<br />
Your samba domain controller may or may not work now that you have completed this untested how to.</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba_domain_controller&diff=90619Samba domain controller2010-01-01T16:02:15Z<p>Pwd: rm smiley face</p>
<hr />
<div>[[Category:HOWTOs (English)]]<br />
This article explains how to setup a simple Windows Domain Controller with user authentication and shares on a small network using samba. Note this Howto is currently only a rough guide and may not work properly<br />
<br />
=Installation=<br />
<br />
Make sure your Arch is up to date:<br />
<br />
pacman -Syu<br />
<br />
Install Samba,<br />
pacman -Sy samba<br />
<br />
Add a user called administrator and make him in the group wheel<br />
<br />
adduser<br />
<br />
=Configuration=<br />
<br />
Static IP is recommended, but not required.<br />
vi /etc/rc.conf<br />
Change your IP,<br />
eth0="eth0 192.168.0.101 netmask 255.255.255.0 broadcast 192.168.0.255"<br />
Save and exit.<br />
<br />
==PreConfiguration==<br />
<br />
run the following commands to create files and change permissions<br />
<br />
mkdir /home/samba<br />
mkdir /home/samba/netlogon<br />
mkdir /home/samba/profiles<br />
chmod 777 /var/spool/samba/<br />
chown -R root:users /home/samba/<br />
chmod -R 771 /home/samba/<br />
mkdir -p /home/shares/allusers<br />
chown -R root:users /home/shares/allusers/<br />
chmod -R ug+rwx,o+rx-w /home/shares/allusers/<br />
<br />
==Samba Config File==<br />
<br />
Create the samba config file<br />
<br />
vi /etc/samba/smb.conf<br />
<br />
Enter the following text<br />
<br />
[global]<br />
workgroup = MIDEARTH<br />
netbios name = archer<br />
server string = Samba Domain Controller<br />
<br />
<br />
passdb backend = tdbsam<br />
security = user<br />
username map = /etc/samba/smbusers<br />
name resolve order = wins bcast hosts<br />
domain logons = yes<br />
preferred master = yes<br />
wins support = yes<br />
<br />
<br />
# Default logon<br />
logon drive = H:<br />
logon script = scripts/logon.bat<br />
logon path = \\archer\profile\%U<br />
<br />
<br />
# Useradd scripts<br />
add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u<br />
delete user script = /usr/sbin/userdel -r %u<br />
add group script = /usr/sbin/groupadd %g<br />
delete group script = /usr/sbin/groupdel %g<br />
add user to group script = /usr/sbin/usermod -G %g %u<br />
add machine script = /usr/sbin/useradd -s /bin/false/ -d /var/lib/nobody %u<br />
idmap uid = 15000-20000<br />
idmap gid = 15000-20000<br />
template shell = /bin/bash<br />
<br />
<br />
# sync smb passwords with linux passwords<br />
passwd program = /usr/bin/passwd %u<br />
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *password\supdated\ssuccessfully* .<br />
passwd chat debug = yes<br />
unix password sync = yes<br />
<br />
# set the loglevel<br />
log level = 3<br />
<br />
[public]<br />
browseable = yes<br />
public = yes<br />
<br />
<br />
[homes]<br />
comment = Home<br />
valid users = %S<br />
read only = no<br />
browsable = no<br />
<br />
<br />
[netlogon]<br />
comment = Network Logon Service<br />
path = /home/samba/netlogon<br />
admin users = administrator<br />
valid users = %U<br />
read only = no<br />
guest ok = yes<br />
writable = no<br />
share modes = no<br />
<br />
<br />
[profile]<br />
comment = User profiles<br />
path = /home/samba/profiles<br />
valid users = %U<br />
create mode = 0600<br />
directory mode = 0700<br />
writable = yes<br />
browsable = no<br />
guest ok = no<br />
<br />
<br />
[allusers]<br />
comment = All Users<br />
path = /home/shares/allusers<br />
valid users = @users<br />
force group = users <br />
create mask = 0660<br />
directory mask = 0771<br />
writable = yes<br />
<br />
==Other Configuration==<br />
<br />
Next restart samba<br />
<br />
/etc/rc.d/samba restart<br />
<br />
Edit the following file<br />
<br />
vi /etc/nsswitch.conf<br />
<br />
And change the line <br />
<br />
hosts: files dns<br />
<br />
to say<br />
<br />
hosts: files wins dns<br />
<br />
Add the root user to the samba password database<br />
<br />
smbpasswd -a root<br />
<br />
This next command tells the server that the user administrator will be our domain admin<br />
<br />
echo "root = administrator" > /etc/samba/smbusers<br />
<br />
Add the default domain groups ('''SUPER IMPORTANT!''')<br />
<br />
net groupmap add ntgroup="Domain Admins" unixgroup=wheel rid=512 type=d<br />
net groupmap add ntgroup="Domain Users" unixgroup=users rid=513 type=d<br />
net groupmap add ntgroup="Domain Guests" unixgroup=nobody rid=514 type=d<br />
<br />
==Adding users==<br />
<br />
First add the user<br />
<br />
useradd username -m -G users<br />
<br />
then add it to the samba database<br />
<br />
smbpasswd -a username<br />
<br />
Restart the samba server just to be sure<br />
<br />
/etc/rc.d/samba restart<br />
<br />
=Finished=<br />
<br />
Your samba domain controller may or may not work now that you have completed this untested how to.</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90618Samba2010-01-01T16:01:19Z<p>Pwd: add summary</p>
<hr />
<div>[[Category:Networking (English)]] [[Category:HOWTOs (English)]]<br />
{{Article summary start|Summary}}<br />
{{Article summary text|Installing, configuring and troubleshooting Samba}}<br />
{{Article summary heading|Language}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba (Dansk)}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|NFS}}<br />
{{Article summary wiki|Samba Domain Controller}}<br />
{{Article summary end}}<br />
<br />
'''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]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
==Installation==<br />
Installing only the client program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the server and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
==Configuration==<br />
The {{filename|/etc/samba/smb.conf}} file must be created before starting the daemons. Once that is setup, users may opt for using an advanced configuration interface like SWAT.<br />
<br />
===smb.conf===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
===Starting and automating the daemons===<br />
If using FAM, start the {{codeline|fam}} [[daemon]] before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
===SWAT: Samba web administration tool===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
===Adding users===<br />
To log into a Samba share you'll need to add a user:<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter:<br />
smb://servername/share<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
Shares may be accessed by using an automatic mounter or by using a [[#Manual share mounting|manual method]].<br />
<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
See [[Autofs]] for information on the kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
=====Adding the share to {{Filename|fstab}}=====<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
=====Allowing users to mount=====<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== Resources ==<br />
*[http://www.samba.org/ Samba's official site]<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90617Samba2010-01-01T15:58:02Z<p>Pwd: correct NFS casing, and omit system rep</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''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]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
==Installation==<br />
Installing only the client program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the server and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
==Configuration==<br />
The {{filename|/etc/samba/smb.conf}} file must be created before starting the daemons. Once that is setup, users may opt for using an advanced configuration interface like SWAT.<br />
<br />
===smb.conf===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
===Starting and automating the daemons===<br />
If using FAM, start the {{codeline|fam}} [[daemon]] before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
===SWAT: Samba web administration tool===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
===Adding users===<br />
To log into a Samba share you'll need to add a user:<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter:<br />
smb://servername/share<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
Shares may be accessed by using an automatic mounter or by using a [[#Manual share mounting|manual method]].<br />
<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
See [[Autofs]] for information on the kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
=====Adding the share to {{Filename|fstab}}=====<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
=====Allowing users to mount=====<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== Resources ==<br />
*[[Samba domain controller]]<br />
*[http://www.samba.org/ Samba's official site]<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90616Samba2010-01-01T15:56:02Z<p>Pwd: merge see also and more resources</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
==Installation==<br />
Installing only the client program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the server and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
==Configuration==<br />
The {{filename|/etc/samba/smb.conf}} file must be created before starting the daemons. Once that is setup, users may opt for using an advanced configuration interface like SWAT.<br />
<br />
===smb.conf===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
===Starting and automating the daemons===<br />
If using FAM, start the {{codeline|fam}} [[daemon]] before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
===SWAT: Samba web administration tool===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
===Adding users===<br />
To log into a Samba share you'll need to add a user:<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter:<br />
smb://servername/share<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
Shares may be accessed by using an automatic mounter or by using a [[#Manual share mounting|manual method]].<br />
<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
See [[Autofs]] for information on the kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
=====Adding the share to {{Filename|fstab}}=====<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
=====Allowing users to mount=====<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== Resources ==<br />
*[[Samba domain controller]]<br />
*[http://www.samba.org/ Samba's official site]<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90615Samba2010-01-01T15:54:19Z<p>Pwd: /* Accessing Samba shares */ correct section components</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
==Installation==<br />
Installing only the client program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the server and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
==Configuration==<br />
The {{filename|/etc/samba/smb.conf}} file must be created before starting the daemons. Once that is setup, users may opt for using an advanced configuration interface like SWAT.<br />
<br />
===smb.conf===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
===Starting and automating the daemons===<br />
If using FAM, start the {{codeline|fam}} [[daemon]] before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
===SWAT: Samba web administration tool===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
===Adding users===<br />
To log into a Samba share you'll need to add a user:<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter:<br />
smb://servername/share<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
Shares may be accessed by using an automatic mounter or by using a [[#Manual share mounting|manual method]].<br />
<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
See [[Autofs]] for information on the kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
=====Adding the share to {{Filename|fstab}}=====<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
=====Allowing users to mount=====<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90614Samba2010-01-01T15:51:14Z<p>Pwd: /* Accessing a Samba share from Gnome or KDE */ space out insructions</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
==Installation==<br />
Installing only the client program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the server and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
==Configuration==<br />
The {{filename|/etc/samba/smb.conf}} file must be created before starting the daemons. Once that is setup, users may opt for using an advanced configuration interface like SWAT.<br />
<br />
===smb.conf===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
===Starting and automating the daemons===<br />
If using FAM, start the {{codeline|fam}} [[daemon]] before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
===SWAT: Samba web administration tool===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
===Adding users===<br />
To log into a Samba share you'll need to add a user:<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter:<br />
smb://servername/share<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
Shares may be accessed by using an automatic mounter or by using a [[#Manual share mounting|manual method]].<br />
<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
See [[Autofs]] for information on the kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90613Samba2010-01-01T15:48:35Z<p>Pwd: /* Accessing a Samba share from the shell */ expand section intro</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
==Installation==<br />
Installing only the client program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the server and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
==Configuration==<br />
The {{filename|/etc/samba/smb.conf}} file must be created before starting the daemons. Once that is setup, users may opt for using an advanced configuration interface like SWAT.<br />
<br />
===smb.conf===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
===Starting and automating the daemons===<br />
If using FAM, start the {{codeline|fam}} [[daemon]] before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
===SWAT: Samba web administration tool===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
===Adding users===<br />
To log into a Samba share you'll need to add a user:<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
Shares may be accessed by using an automatic mounter or by using a [[#Manual share mounting|manual method]].<br />
<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
See [[Autofs]] for information on the kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90612Samba2010-01-01T15:46:03Z<p>Pwd: /* Configuration */ expand section intro</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
==Installation==<br />
Installing only the client program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the server and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
==Configuration==<br />
The {{filename|/etc/samba/smb.conf}} file must be created before starting the daemons. Once that is setup, users may opt for using an advanced configuration interface like SWAT.<br />
<br />
===smb.conf===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
===Starting and automating the daemons===<br />
If using FAM, start the {{codeline|fam}} [[daemon]] before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
===SWAT: Samba web administration tool===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
===Adding users===<br />
To log into a Samba share you'll need to add a user:<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
[[Autofs]] is a kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90611Samba2010-01-01T15:44:39Z<p>Pwd: /* Starting and automating the daemons */ add ln to daemon</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
==Installation==<br />
Installing only the client program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the server and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
==Configuration==<br />
The {{filename|/etc/samba/smb.conf}} file must be created before starting the server.<br />
<br />
===smb.conf===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
===Starting and automating the daemons===<br />
If using FAM, start the {{codeline|fam}} [[daemon]] before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
===SWAT: Samba web administration tool===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
===Adding users===<br />
To log into a Samba share you'll need to add a user:<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
[[Autofs]] is a kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90610Samba2010-01-01T15:43:56Z<p>Pwd: /* Configuration */ fx tmpl</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
==Installation==<br />
Installing only the client program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the server and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
==Configuration==<br />
The {{filename|/etc/samba/smb.conf}} file must be created before starting the server.<br />
<br />
===smb.conf===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
===Starting and automating the daemons===<br />
If using FAM, start the {{codeline|fam}} daemon before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
===SWAT: Samba web administration tool===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
===Adding users===<br />
To log into a Samba share you'll need to add a user:<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
[[Autofs]] is a kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90609Samba2010-01-01T15:43:30Z<p>Pwd: more server vs client</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
==Installation==<br />
Installing only the client program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the server and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
==Configuration==<br />
The {{/etc/samba/smb.conf}} file must be created before starting the server.<br />
<br />
===smb.conf===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
===Starting and automating the daemons===<br />
If using FAM, start the {{codeline|fam}} daemon before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
===SWAT: Samba web administration tool===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
===Adding users===<br />
To log into a Samba share you'll need to add a user:<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
[[Autofs]] is a kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90607Samba2010-01-01T15:34:11Z<p>Pwd: /* Installation */ clar on server vs client</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
== Installation ==<br />
Installing only the client program is sufficient for systems that are not meant to share files, only access them:<br />
# pacman -S smbclient<br />
<br />
In order to make shares available to clients, install the Samba ''server'' package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the server and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
If using FAM, start the {{codeline|fam}} daemon before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
Note: Before Starting samba the file /etc/samba/smb.conf must be created, see Configuration Below.<br />
<br />
== Configuration ==<br />
=== smb.conf ===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
=== SWAT: Samba Web Administration Tool ===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
=== Adding users ===<br />
To log into a Samba share you'll need to add a user:<br />
<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
[[Autofs]] is a kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90605Samba2010-01-01T15:30:40Z<p>Pwd: /* Discovering network shares */ update links to reflect new merge</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
== Installation ==<br />
To install the Samba server, install the {{Package Official|samba}} package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the package and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
If using FAM, start the {{codeline|fam}} daemon before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
Note: Before Starting samba the file /etc/samba/smb.conf must be created, see Configuration Below.<br />
<br />
== Configuration ==<br />
=== smb.conf ===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
=== SWAT: Samba Web Administration Tool ===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
=== Adding users ===<br />
To log into a Samba share you'll need to add a user:<br />
<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
[[Autofs]] is a kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[#smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares.<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90604Samba2010-01-01T15:28:28Z<p>Pwd: /* Autofs */ rm 'See:' prefix, for now</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
== Installation ==<br />
To install the Samba server, install the {{Package Official|samba}} package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the package and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
If using FAM, start the {{codeline|fam}} daemon before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
Note: Before Starting samba the file /etc/samba/smb.conf must be created, see Configuration Below.<br />
<br />
== Configuration ==<br />
=== smb.conf ===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
=== SWAT: Samba Web Administration Tool ===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
=== Adding users ===<br />
To log into a Samba share you'll need to add a user:<br />
<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
[[Autofs]] is a kernel-based automounter for Linux.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[Windows Network Share#smbnetfs|smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares. See also: [[Windows Network Share]].<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90603Samba2010-01-01T15:27:26Z<p>Pwd: rm ln to Windows Network Share: merged</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward.<br />
<br />
== Installation ==<br />
To install the Samba server, install the {{Package Official|samba}} package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the package and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
If using FAM, start the {{codeline|fam}} daemon before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
Note: Before Starting samba the file /etc/samba/smb.conf must be created, see Configuration Below.<br />
<br />
== Configuration ==<br />
=== smb.conf ===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
=== SWAT: Samba Web Administration Tool ===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
=== Adding users ===<br />
To log into a Samba share you'll need to add a user:<br />
<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
Autofs is a kernel-based automounter for Linux. See: [[Autofs]] for details.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[Windows Network Share#smbnetfs|smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares. See also: [[Windows Network Share]].<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Windows_Network_Share&diff=90602Windows Network Share2010-01-01T15:26:55Z<p>Pwd: redir to Samba: no content was windows specific, resulting in a merge</p>
<hr />
<div>#REDIRECT[[Samba]]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90601Samba2010-01-01T15:24:02Z<p>Pwd: /* Allowing users to mount */ fix ln to smbnetfs</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward. See: [[Windows Network Share]] for more information about accessing Windows shares.<br />
<br />
== Installation ==<br />
To install the Samba server, install the {{Package Official|samba}} package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the package and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
If using FAM, start the {{codeline|fam}} daemon before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
Note: Before Starting samba the file /etc/samba/smb.conf must be created, see Configuration Below.<br />
<br />
== Configuration ==<br />
=== smb.conf ===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
=== SWAT: Samba Web Administration Tool ===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
=== Adding users ===<br />
To log into a Samba share you'll need to add a user:<br />
<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
Autofs is a kernel-based automounter for Linux. See: [[Autofs]] for details.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[Windows Network Share#smbnetfs|smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares. See also: [[Windows Network Share]].<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90600Samba2010-01-01T15:23:13Z<p>Pwd: /* Accessing a Samba share from the shell */ merge from Windows Network Share</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward. See: [[Windows Network Share]] for more information about accessing Windows shares.<br />
<br />
== Installation ==<br />
To install the Samba server, install the {{Package Official|samba}} package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the package and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
If using FAM, start the {{codeline|fam}} daemon before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
Note: Before Starting samba the file /etc/samba/smb.conf must be created, see Configuration Below.<br />
<br />
== Configuration ==<br />
=== smb.conf ===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
=== SWAT: Samba Web Administration Tool ===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
=== Adding users ===<br />
To log into a Samba share you'll need to add a user:<br />
<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
====Automatic share mounting====<br />
There are several alternatives for easy share browsing.<br />
<br />
=====smbnetfs=====<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
=====fusesmb=====<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
=====Autofs=====<br />
Autofs is a kernel-based automounter for Linux. See: [[Autofs]] for details.<br />
<br />
====Manual share mounting====<br />
1. Use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
2. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
3. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
4. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[Windows Network Share#smbnetfs|smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares. See also: [[Windows Network Share]].<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90599Samba2010-01-01T15:19:32Z<p>Pwd: /* Adding the share to {{Filename|fstab}} */ rm users mount option</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward. See: [[Windows Network Share]] for more information about accessing Windows shares.<br />
<br />
== Installation ==<br />
To install the Samba server, install the {{Package Official|samba}} package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the package and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
If using FAM, start the {{codeline|fam}} daemon before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
Note: Before Starting samba the file /etc/samba/smb.conf must be created, see Configuration Below.<br />
<br />
== Configuration ==<br />
=== smb.conf ===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
=== SWAT: Samba Web Administration Tool ===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
=== Adding users ===<br />
To log into a Samba share you'll need to add a user:<br />
<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
You can use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
====Manual share mounting====<br />
1. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
2. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
3. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[Windows Network Share#smbnetfs|smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares. See also: [[Windows Network Share]].<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90598Samba2010-01-01T15:18:18Z<p>Pwd: /* Adding users */ clar and sp</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward. See: [[Windows Network Share]] for more information about accessing Windows shares.<br />
<br />
== Installation ==<br />
To install the Samba server, install the {{Package Official|samba}} package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the package and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
If using FAM, start the {{codeline|fam}} daemon before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
Note: Before Starting samba the file /etc/samba/smb.conf must be created, see Configuration Below.<br />
<br />
== Configuration ==<br />
=== smb.conf ===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
=== SWAT: Samba Web Administration Tool ===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
=== Adding users ===<br />
To log into a Samba share you'll need to add a user:<br />
<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will receive the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the Linux host with [[User Management#adduser|adduser]]. This article does not cover adding users to Windows systems.<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
You can use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
====Manual share mounting====<br />
1. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
2. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
3. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,users,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[Windows Network Share#smbnetfs|smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares. See also: [[Windows Network Share]].<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90595Samba2010-01-01T15:16:07Z<p>Pwd: /* Allowing users to mount */ merge from Windows Network Share</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward. See: [[Windows Network Share]] for more information about accessing Windows shares.<br />
<br />
== Installation ==<br />
To install the Samba server, install the {{Package Official|samba}} package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the package and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
If using FAM, start the {{codeline|fam}} daemon before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
Note: Before Starting samba the file /etc/samba/smb.conf must be created, see Configuration Below.<br />
<br />
== Configuration ==<br />
=== smb.conf ===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
=== SWAT: Samba Web Administration Tool ===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
=== Adding users ===<br />
To log into a Samba share you'll need to add a user:<br />
<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will recieve the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the system with [[User Management#adduser|adduser]].<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
You can use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
====Manual share mounting====<br />
1. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
2. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
3. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,users,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /path/to/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
This will allow users to mount it aslong 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]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[Windows Network Share#smbnetfs|smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares. See also: [[Windows Network Share]].<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90593Samba2010-01-01T15:11:22Z<p>Pwd: /* Accessing Samba shares */ organize merge</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward. See: [[Windows Network Share]] for more information about accessing Windows shares.<br />
<br />
== Installation ==<br />
To install the Samba server, install the {{Package Official|samba}} package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the package and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
If using FAM, start the {{codeline|fam}} daemon before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
Note: Before Starting samba the file /etc/samba/smb.conf must be created, see Configuration Below.<br />
<br />
== Configuration ==<br />
=== smb.conf ===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
=== SWAT: Samba Web Administration Tool ===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
=== Adding users ===<br />
To log into a Samba share you'll need to add a user:<br />
<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will recieve the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the system with [[User Management#adduser|adduser]].<br />
<br />
==Accessing Samba shares==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
===Accessing a Samba share from Gnome or KDE===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
You can use [[smbclient]] to browse shares from the shell. To list any public shares on a server:<br />
$ smbclient -L <hostname> -U%<br />
<br />
====Manual share mounting====<br />
1. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
2. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
3. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|fstab}}===<br />
Add the following to {{Filename|/etc/[[fstab]]}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,users,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
If adding a Samba share to {{Filename|fstab}}, the {{codeline|netfs}} daemon should also be added to {{Filename|[[rc.conf]]}}, somewhere after the [[network]] daemon. The {{codeline|netfs}} daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if using the {{codeline|noauto}} option in {{Filename|fstab}}, the {{codeline|netfs}} daemon should be used. Without it any network share that is mounted when shutting down will cause the {{codeline|network}} daemon to wait for the connection to time out, considerably extending poweroff time.<br />
<br />
===Allowing users to mount===<br />
You can add a line to {{Filename|[[fstab]]}} like this:<br />
<br />
//<hostname>/<share> <mount_point> cifs credentials=<credentials_file>,rw,user,noauto 0 0<br />
<br />
Since {{Filename|fstab}} is readable by all users, one should not store their Samba password in this file. In this case, use a credentials file that is only readable by root. This is a simple text file that contains:<br />
<br />
username=<username><br />
password=<password><br />
<br />
The {{codeline|user}} option of the {{Filename|fstab}} line allows the owner of the <mount_point> to mount and unmount the share. The {{codeline|noauto}} option disables mounting at boot.<br />
<br />
For users to be allowed to mount and unmount the Samba shares with mount points outside their home directory, use [[smbnetfs]], or grant privileges using [[sudo]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[Windows Network Share#smbnetfs|smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares. See also: [[Windows Network Share]].<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90592Samba2010-01-01T15:03:35Z<p>Pwd: /* Accessing a Samba share from the shell */ merge from Windows Network Share</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward. See: [[Windows Network Share]] for more information about accessing Windows shares.<br />
<br />
== Installation ==<br />
To install the Samba server, install the {{Package Official|samba}} package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the package and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
If using FAM, start the {{codeline|fam}} daemon before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
Note: Before Starting samba the file /etc/samba/smb.conf must be created, see Configuration Below.<br />
<br />
== Configuration ==<br />
=== smb.conf ===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
=== SWAT: Samba Web Administration Tool ===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
=== Adding users ===<br />
To log into a Samba share you'll need to add a user:<br />
<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will recieve the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the system with [[User Management#adduser|adduser]].<br />
<br />
== Accessing Samba shares ==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
=== Accessing a Samba share from Gnome or KDE ===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
===Accessing a Samba share from the shell===<br />
You can use [[smbclient]] to browse shares from the shell:<br />
$ smbclient -L <hostname> -U%<br />
<br />
will list any public shares on the server.<br />
<br />
====Manual share mounting====<br />
1. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
2. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
3. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|/etc/fstab}}===<br />
Add the following to {{Filename|/etc/fstab}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,users,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
===Allowing users to mount===<br />
For users to be allowed to mount and unmount the Samba share, use [[smbnetfs]], or grant privileges using [[sudo]].<br />
<br />
=== Adding a share to fstab ===<br />
You can add a line to {{Filename|[[fstab]]}} like this:<br />
<br />
//<hostname>/<share> <mount_point> cifs credentials=<credentials_file>,rw,user,noauto 0 0<br />
<br />
Since {{Filename|fstab}} is readable by all users, one should not store their Samba password in this file. In this case, use a credentials file that is only readable by root. This is a simple text file that contains:<br />
<br />
username=<username><br />
password=<password><br />
<br />
The '''user''' option of the {{Filename|fstab}} line allows the owner of the <mount_point> to mount and unmount the share. The '''noauto''' option disables mounting at boot.<br />
<br />
If you are adding a Samba share to {{Filename|fstab}}, you should also add the '''netfs''' daemon to {{Filename|[[rc.conf]]}}, somewhere after the '''[[network]]''' daemon. The '''netfs''' daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if you are using the '''noauto''' option in {{Filename|fstab}} you should add the '''netfs''' daemon. Without it any network share that is mounted when you shutdown will cause the '''network''' daemon to wait for the connection to time out, considerably extending your shutdown time.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[Windows Network Share#smbnetfs|smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares. See also: [[Windows Network Share]].<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Windows_Network_Share&diff=90590Windows Network Share2010-01-01T14:55:34Z<p>Pwd: /* Autofs */ rm repeated ln</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of methods available to users wishing to access Windows shares using [[Samba]].}}<br />
{{Article summary heading|Available in languages}}<br />
{{i18n entry|English|Windows Network Share}}<br />
{{Article summary heading|Related articles}}<br />
{{Article summary wiki|NFS}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary end}}<br />
==Preparation==<br />
Install the {{Package Official|smbclient}} package with [[pacman]]:<br />
# pacman -S smbclient<br />
<br />
==Automatic share mounting==<br />
There are several alternatives for easy share browsing.<br />
<br />
===smbnetfs===<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
===fusesmb===<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
===Autofs===<br />
Autofs is a kernel-based automounter for Linux. See: [[Autofs]] for details.<br />
<br />
==Manual share mounting==<br />
1. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
2. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
3. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|/etc/fstab}}===<br />
Add the following to {{Filename|/etc/fstab}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,users,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /mnt/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
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:<br />
# chmod u+s /sbin/mount.cifs<br />
# chmod u+s /sbin/umount.cifs<br />
<br />
{{Warning|A more secure option is to use [[sudo]] to grant privileges. Setting the [[Wikipedia:setuid|setuid]] bit is potentially dangerous and is not recommended.}}</div>Pwdhttps://wiki.archlinux.org/index.php?title=Windows_Network_Share&diff=90589Windows Network Share2010-01-01T14:53:21Z<p>Pwd: /* Allowing users to mount */ mv notes after content</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of methods available to users wishing to access Windows shares using [[Samba]].}}<br />
{{Article summary heading|Available in languages}}<br />
{{i18n entry|English|Windows Network Share}}<br />
{{Article summary heading|Related articles}}<br />
{{Article summary wiki|NFS}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary end}}<br />
==Preparation==<br />
Install the {{Package Official|smbclient}} package with [[pacman]]:<br />
# pacman -S smbclient<br />
<br />
==Automatic share mounting==<br />
There are several alternatives for easy share browsing.<br />
<br />
===smbnetfs===<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
===fusesmb===<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
===Autofs===<br />
[[Autofs]] is a kernel-based automounter for Linux. See the [[Autofs]] wiki article for details.<br />
<br />
==Manual share mounting==<br />
1. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
2. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
3. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|/etc/fstab}}===<br />
Add the following to {{Filename|/etc/fstab}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,users,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /mnt/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
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:<br />
# chmod u+s /sbin/mount.cifs<br />
# chmod u+s /sbin/umount.cifs<br />
<br />
{{Warning|A more secure option is to use [[sudo]] to grant privileges. Setting the [[Wikipedia:setuid|setuid]] bit is potentially dangerous and is not recommended.}}</div>Pwdhttps://wiki.archlinux.org/index.php?title=Windows_Network_Share&diff=90588Windows Network Share2010-01-01T14:52:08Z<p>Pwd: remove intro stub</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of methods available to users wishing to access Windows shares using [[Samba]].}}<br />
{{Article summary heading|Available in languages}}<br />
{{i18n entry|English|Windows Network Share}}<br />
{{Article summary heading|Related articles}}<br />
{{Article summary wiki|NFS}}<br />
{{Article summary wiki|Samba}}<br />
{{Article summary end}}<br />
==Preparation==<br />
Install the {{Package Official|smbclient}} package with [[pacman]]:<br />
# pacman -S smbclient<br />
<br />
==Automatic share mounting==<br />
There are several alternatives for easy share browsing.<br />
<br />
===smbnetfs===<br />
1. Install {{Package Official|smbnetfs}}:<br />
# pacman -S smbnetfs<br />
<br />
2. Add the following line to {{Filename|/etc/fuse.conf}}:<br />
user_allow_other<br />
<br />
3. Load the {{Codeline|fuse}} kernel module:<br />
# modprobe fuse<br />
<br />
4. Start the {{Codeline|smbnetfs}} [[daemon]]:<br />
# /etc/rc.d/smbnetfs start<br />
<br />
All shares in the network are now automatically mounted under {{Filename|/mnt/smbnet}}.<br />
<br />
Add the following to {{Filename|/etc/rc.conf}} to access the shares at boot:<br />
MODULES=(... '''fuse''' ...)<br />
DAEMONS=(... '''smbnetfs''' ...)<br />
<br />
===fusesmb===<br />
{{Note|1=Because {{Codeline|smbclient 3.2.X}} is malfunctioning with {{Codeline|fusesmb}}, revert to using older versions if necessary. See the [http://bbs.archlinux.org/viewtopic.php?id=58434 relevant forum topic] for details.}}<br />
<br />
1. Install the {{Package AUR|fusesmb}} package from the [[AUR]] using [[yaourt]] or other [[AUR Helpers]]:<br />
$ yaourt -S fusesmb<br />
<br />
2. Create a mount point:<br />
# mkdir /mnt/fusesmb<br />
<br />
3. Load {{Codeline|fuse}} module:<br />
# modprobe fuse<br />
<br />
4. Mount the shares:<br />
# fusesmb -o allow_other /mnt/fusesmb<br />
<br />
For mounting shares at boot, add the command above to {{Filename|/etc/rc.local}} and add {{Codeline|fuse}} module to {{Filename|/etc/rc.conf}}:<br />
MODULES=(... '''fuse''' ...)<br />
<br />
===Autofs===<br />
[[Autofs]] is a kernel-based automounter for Linux. See the [[Autofs]] wiki article for details.<br />
<br />
==Manual share mounting==<br />
1. Create the mount point for the share:<br />
# mkdir /mnt/MOUNTPOINT<br />
<br />
2. Mount the share using {{Codeline|mount.cifs}}. Keep in mind that not all options may be needed nor desirable, such as {{Codeline|password}}:<br />
# mount -t cifs //''SERVER''/''SHARENAME'' ''MOUNTPOINT'' -o user=''USERNAME'',password=''PASSWORD'',workgroup=''WORKGROUP'',ip=''SERVERIP''<br />
<br />
;{{Codeline|SERVER}}: The Windows system's name<br />
;{{Codeline|SHARENAME}}: The shared directory<br />
;{{Codeline|MOUNTPOINT}}: The local directory where the share will be mounted to<br />
;{{Codeline|-o [options]}}: Specifies options for {{Codeline|mount.cifs}}<br />
:;{{Codeline|user}}: Username used to mount the share<br />
:;{{Codeline|password}}: The shared directory's password<br />
:;{{Codeline|workgroup}}: Used to specify the workgroup<br />
:;{{Codeline|ip}}: The IP address of the server -- if the system is unable to find the Windows computer by name (DNS, WINS, hosts entry, etc.)<br />
<br />
{{Note|Abstain from using trailing directory ('''/''') characters. Using {{Filename|//SERVER/SHARENAME'''/'''}} will not work.}}<br />
<br />
3. To unmount the share, use:<br />
# umount /mnt/MOUNTPOINT<br />
<br />
===Adding the share to {{Filename|/etc/fstab}}===<br />
Add the following to {{Filename|/etc/fstab}} for easy mounting:<br />
//SERVER/SHARENAME /mnt/MOUNTPOINT cifs noauto,noatime,users,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
The {{Codeline|noauto}} option disables mounting it automatically at boot and {{Codeline|noatime}} increases performance by skipping inode access times.<br />
<br />
After adding the previous line, the syntax to mount files becomes simpler:<br />
# mount /mnt/MOUNTPOINT<br />
<br />
===Allowing users to mount===<br />
Before enabling access to the mount commands, {{Filename|fstab}} needs to be modified. Add the {{Codeline|users}} options to the entry in {{Filename|/etc/fstab}}:<br />
//SERVER/SHARENAME /mnt/SHAREMOUNT cifs '''users''',noauto,noatime,username=USER,password=PASSWORD,workgroup=WORKGROUP 0 0<br />
<br />
{{Note|The option is {{codeline|user'''s'''}} (plural). For other filesystem types handled by mount, this option is usually ''user''; sans the "'''s'''".}}<br />
<br />
{{Warning|A more secure option is to use [[sudo]] to grant privileges. Setting the [[Wikipedia:setuid|setuid]] bit is potentially dangerous and is not recommended.}}<br />
<br />
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:<br />
# chmod u+s /sbin/mount.cifs<br />
# chmod u+s /sbin/umount.cifs</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samba&diff=90587Samba2010-01-01T14:51:28Z<p>Pwd: add ln to Windows Network Share</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|Česky|:Samba (Česky)}}<br />
{{i18n_entry|Dansk|:Samba_(Dansk)}}<br />
{{i18n_entry|Deutsch|:#More Resources}}<br />
{{i18n_entry|English|:Samba}}<br />
{{i18n_entry|Español|:Samba (Español)}}<br />
{{i18n_entry|Italiano|:Samba (Italiano)}}<br />
{{i18n_entry|Română|:Samba (română)}}<br />
{{i18n_entry|Русский|:Samba (Русский)}}<br />
{{i18n_entry|Türkçe|:Samba (Türkçe)}}<br />
{{i18n_entry|简体中文|:Samba (简体中文)}}<br />
{{i18n_entry|正體中文|:Samba 配置}}<br />
{{i18n_links_end}}<br />
<br />
'''Samba''' is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing between Linux and Windows systems or Linux-to-Linux systems as an alternative to [[Nfs]]. Samba is easily configured and operation is very straight-forward. See: [[Windows Network Share]] for more information about accessing Windows shares.<br />
<br />
== Installation ==<br />
To install the Samba server, install the {{Package Official|samba}} package:<br />
# pacman -S samba<br />
<br />
A daemon is installed with the package and it must be started for Samba to begin working. Samba typically uses [[FAM]] to monitor the file-system for changes, yet [[Gamin]] has almost completely replaced FAM as of recent, mainly because the latter is poorly maintained and generally an inferior, unpopular choice.<br />
<br />
To install Gamin:<br />
# pacman -S gamin<br />
<br />
If using FAM, start the {{codeline|fam}} daemon before {{codeline|samba}}. Gamin does not need a daemon since it automatically starts when needed.<br />
<br />
Without rebooting, FAM and Samba can be started with the commands:<br />
# /etc/rc.d/fam start<br />
# /etc/rc.d/samba start<br />
<br />
Add {{codeline|fam}} and {{codeline|samba}} to the DAEMONS line in {{Filename|[[rc.conf]]}} to automatically start the daemons at boot.<br />
<br />
Note: Before Starting samba the file /etc/samba/smb.conf must be created, see Configuration Below.<br />
<br />
== Configuration ==<br />
=== smb.conf ===<br />
As root, copy the default Samba configuration file to {{Filename|/etc/samba/smb.conf}}:<br />
<br />
# cp /etc/samba/smb.conf.default /etc/samba/smb.conf<br />
<br />
Open {{Filename|smb.conf}} and edit it to suit your needs. The default file creates a share for each user's home directory. It also creates a share for printers.<br />
<br />
=== SWAT: Samba Web Administration Tool ===<br />
[http://samba.xsec.it/samba/docs/man/Samba-HOWTO-Collection/SWAT.html SWAT] is a facility that is part of the Samba suite. The main executable is called swat and is invoked by the internetworking super daemon, [[Wikipedia:inetd|inetd]]. <br />
<br />
There are many and varied opinions regarding the usefulness of SWAT. No matter how hard one tries to produce the perfect configuration tool, it remains an object of personal taste. However, SWAT is a very useful tool that allows Web-based configuration of Samba. It has a wizard that may help to get Samba configured quickly, it has context-sensitive help on each {{Filename|smb.conf}} parameter, it provides for monitoring of current state of connection information, and it allows network-wide MS Windows network password management.<br />
<br />
{{Warning|Before using SWAT, please be warned SWAT will completely replace your {{Filename|smb.conf}} with a fully optimized file that has been stripped of all comments you might have placed there, and only non-default settings will be written to the file.}}<br />
<br />
To use SWAT, first install xinetd:<br />
<br />
# pacman -Sy xinetd<br />
<br />
Edit {{Filename|/etc/xinetd.d/swat}} using your favorite text editor. To enable SWAT, change the {{Codeline|1=disable = yes}} line to {{Codeline|1=disable = no}}.<br />
<br />
Additionally, edit {{Filename|/etc/hosts.allow}} if remote administration is needed.<br />
<br />
The web interface can be accessed on port 901 by default,<br />
<br />
http://localhost:901/<br />
<br />
{{Note|If you have problems with these directions, you can use the more all-encompasing [[Webmin]] tool instead, and easily load the SWAT module there.}}<br />
<br />
=== Adding users ===<br />
To log into a Samba share you'll need to add a user:<br />
<br />
# smbpasswd -a <user><br />
<br />
The user must already have a account on the server. If the user does not exist you will recieve the error:<br />
Failed to modify password entry for user "<user>"<br />
<br />
You can add a new user to the system with [[User Management#adduser|adduser]].<br />
<br />
== Accessing Samba shares ==<br />
KDE and Gnome have the ability to browse Samba shares. You therefore do not need any additional packages if using either of these DEs. If however you plan to use the share solely from a shell, you will need an additional package.<br />
<br />
=== Accessing a Samba share from Gnome or KDE ===<br />
From a Nautilus/Dolphin/Konqueror window, hit {{Keypress|Ctrl}}+{{Keypress|L}} or go to the "Go" menu and select "Location..." -- both actions will allow you to type in the "Go to:" blank. Enter {{Codeline|smb://servername/share}} and press enter.<br />
<br />
{{Note|If you do not have your servername in your {{Filename|/etc/hosts}}, you must use the IP Address of the server in place of the servername.}}<br />
<br />
For a GUI in the KDE System Settings you have to install the kdenetwork-filesharing package from [extra].<br />
<br />
=== Accessing a Samba share from the shell ===<br />
You can use [[smbclient]] to browse shares from the shell:<br />
<br />
$ smbclient -L <hostname> -U%<br />
<br />
will list any public shares on the server.<br />
<br />
To manually mount a share from the shell:<br />
<br />
# mount.cifs //<hostname>/<share> <mount_point> -o user=<username>,password=<password><br />
<br />
To allow a normal user to mount and unmount a Samba share you can add setuid root to {{Filename|/sbin/mount.cifs}}. An alternative is to use the [[smbnetfs]] package.<br />
<br />
=== Adding a share to fstab ===<br />
You can add a line to {{Filename|[[fstab]]}} like this:<br />
<br />
//<hostname>/<share> <mount_point> cifs credentials=<credentials_file>,rw,user,noauto 0 0<br />
<br />
Since {{Filename|fstab}} is readable by all users, one should not store their Samba password in this file. In this case, use a credentials file that is only readable by root. This is a simple text file that contains:<br />
<br />
username=<username><br />
password=<password><br />
<br />
The '''user''' option of the {{Filename|fstab}} line allows the owner of the <mount_point> to mount and unmount the share. The '''noauto''' option disables mounting at boot.<br />
<br />
If you are adding a Samba share to {{Filename|fstab}}, you should also add the '''netfs''' daemon to {{Filename|[[rc.conf]]}}, somewhere after the '''[[network]]''' daemon. The '''netfs''' daemon will mount network partitions at boot and, more importantly, unmount network partitions at shutdown. Even if you are using the '''noauto''' option in {{Filename|fstab}} you should add the '''netfs''' daemon. Without it any network share that is mounted when you shutdown will cause the '''network''' daemon to wait for the connection to time out, considerably extending your shutdown time.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Share files for your LAN without user and password ===<br />
<br />
Edit {{Filename|/etc/samba/smb.conf}} and change the following line:<br />
<br />
security = user<br />
<br />
to<br />
<br />
security = share<br />
<br />
If you want to restrict the shares data to a specific interface replace:<br />
<br />
; interfaces = 192.168.12.2/24 192.168.13.2/24<br />
<br />
with:<br />
<br />
interfaces = lo eth0<br />
bind interfaces only = true<br />
<br />
(changing eth0 to the local network you want share with.)<br />
<br />
If you want to edit the account that access the shares, edit the following line:<br />
<br />
; guest account = nobody<br />
<br />
The last step is to create share directory (for write access make writable = yes):<br />
<br />
[Public Share]<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Sample configuration file ===<br />
<br />
The configuration that worked for one user:<br />
[global]<br />
workgroup = WORKGROUP<br />
server string = Samba Server<br />
netbios name = PC_NAME<br />
security = share<br />
; the line below is important! If you have permission issues make sure the user here is the same as the user of the folder you want to share<br />
guest account = mark<br />
username map = /etc/samba/smbusers<br />
name resolve order = hosts wins bcast<br />
wins support = no<br /><br />
[public]<br />
comment = Public Share<br />
path = /path/to/public/share<br />
available = yes<br />
browsable = yes<br />
public = yes<br />
writable = no<br />
<br />
=== Discovering network shares ===<br />
<br />
If nothing is known about other systems on the local network, and automated tools such as [[Windows Network Share#smbnetfs|smbnetfs]] are not available, the following methods allow one to manually probe for Samba shares. See also: [[Windows Network Share]].<br />
<br />
1. First, install {{Package Official|nmap}} and {{Package Official|smbclient}} using [[pacman]]:<br />
# pacman -S nmap smbclient<br />
<br />
2. {{Codeline|nmap}} checks which ports are open:<br />
# nmap -sT 192.168.1.*<br />
<br />
In this case, a scan on the 192.168.1.* IP address range has been performed, resulting in:<br />
{{Command<br />
|name=nmap -sT 192.168.1.*<br />
|output=Starting nmap 3.78 ( http://www.insecure.org/nmap/ ) at 2005-02-15 11:45 PHT<br />
Interesting ports on 192.168.1.1:<br />
(The 1661 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
'''139/tcp open netbios-ssn'''<br />
5000/tcp open UPnP<br />
<br />
Interesting ports on 192.168.1.5:<br />
(The 1662 ports scanned but not shown below are in state: closed)<br />
PORT STATE SERVICE<br />
6000/tcp open X11<br />
<br />
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 7.255 seconds<br />
}}<br />
<br />
The first result is another system; the second happens to be the client from where this scan was performed.<br />
<br />
3. Now that systems with port 139 open are revealed, use {{Codeline|nmblookup}} to check for NetBIOS names: <br />
{{Command<br />
|name=nmblookup -A 192.168.1.1<br />
|output=Looking up status of 192.168.1.1<br />
PUTER <00> - B <ACTIVE><br />
HOMENET <00> - <GROUP> B <ACTIVE><br />
PUTER <03> - B <ACTIVE><br />
'''PUTER <20> - B <ACTIVE>'''<br />
HOMENET <1e> - <GROUP> B <ACTIVE><br />
USERNAME <03> - B <ACTIVE><br />
HOMENET <1d> - B <ACTIVE><br />
MSBROWSE <01> - <GROUP> B <ACTIVE><br />
}}<br />
<br />
Regardless of the output, look for '''<20>''', which shows the host with open services.<br />
<br />
4. Use {{Codeline|smbclient}} to list which services are shared on ''PUTER''. If prompted for a password, pressing enter should still display the list:<br />
{{Command<br />
|name=smbclient -L \\PUTER<br />
|output=<nowiki><br />
Sharename Type Comment<br />
--------- ---- -------<br />
MY_MUSIC Disk<br />
SHAREDDOCS Disk<br />
PRINTER$ Disk<br />
PRINTER Printer<br />
IPC$ IPC Remote Inter Process Communication<br />
<br />
Server Comment<br />
--------- -------<br />
PUTER<br />
<br />
Workgroup Master<br />
--------- -------<br />
HOMENET PUTER<br />
</nowiki>}}<br />
<br />
This shows which folders are shared and can be mounted locally. See: [[#Accessing Samba shares]]<br />
<br />
== Troubleshooting ==<br />
=== Trouble accessing a password-protected share from Windows ===<br />
<br />
If you are having trouble accessing a password protected share from Windows, try adding this to {{Filename|/etc/samba/smb.conf}}:[http://blogs.computerworld.com/networking_nightmare_ii_adding_linux]<br />
<br />
[global]<br />
# lanman fix<br />
client lanman auth = yes<br />
client ntlmv2 auth = no<br />
<br />
=== Getting a dialog box up takes a long time ===<br />
<br />
I had a problem that it took ~30 seconds to get a password dialog box up when trying to connect from both Windows XP/Windows 7. Analyzing the error.log on the server I saw:<br />
<br />
[2009/11/11 06:20:12, 0] printing/print_cups.c:cups_connect(103)<br />
Unable to connect to CUPS server localhost:631 - Interrupted system call<br />
<br />
I don't have any printer connected to this server, so I added this to the global section:<br />
<br />
load printers = no<br />
printing = bsd<br />
disable spoolss = yes<br />
printcap name = /dev/null<br />
<br />
Not sure if all of them are necessary, but at least it works now.<br />
<br />
=== Changes in Samba version 3.4.0 ===<br />
<br />
[http://www.samba.org/samba/history/samba-3.4.0.html Major enhancements in Samba 3.4.0] include:<br />
<br />
The default passdb backend has been changed to 'tdbsam'! That breaks existing setups using the 'smbpasswd' backend without explicit declaration!<br />
<br />
If you would like to stick to the 'smbpasswd' backend try changing this in {{Filename|/etc/samba/smb.conf}}:<br />
<br />
passdb backend = smbpasswd<br />
<br />
or convert your smbpasswd entries using:<br />
<br />
sudo pdbedit -i smbpasswd -e tdbsam<br />
<br />
=== Error: Value too large for defined data type ===<br />
<br />
With some applications you could get this error whith every attempt to open a file mounted in smbfs/cifs:<br />
<br />
Value too large for defined data type<br />
<br />
The solution[https://bugs.launchpad.net/ubuntu/+bug/479266/comments/5] is to add this options to your smbfs/cifs mount options (in /etc/fstab for example):<br />
<br />
,nounix,noserverino<br />
<br />
''It works on Arch Linux up-to-date (2009-12-02)''<br />
<br />
== See also ==<br />
*[[Samba domain controller]]<br />
<br />
== More resources ==<br />
*http://www.samba.org/<br />
*[http://www.samba.org/samba/docs/SambaIntro.html Samba: An Introduction]</div>Pwdhttps://wiki.archlinux.org/index.php?title=Lm_sensors&diff=90586Lm sensors2010-01-01T13:50:48Z<p>Pwd: rm gap; fx displaytitle</p>
<hr />
<div>[[Category:Mainboards and BIOS (English)]]<br />
[[Category:CPU (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Lm_sensors}}<br />
{{i18n_entry|Česky|Lm_sensors (Česky)}}<br />
{{i18n_entry|Русский|Настройка Lm_sensors}}<br />
{{i18n_entry|Українська|Lm_sensors_(Українська)}}<br />
{{i18n_entry|简体中文|Lm sensors (简体中文)}}<br />
{{i18n_links_end}}<br />
{{DISPLAYTITLE:lm sensors}}<br />
This document tells you how to install, setup, and use '''lm_sensors''' so that you can monitor CPU and/or motherboard temperature and fan speeds.<br />
<br />
== Summary ==<br />
[http://www.lm-sensors.org/ lm_sensors] (Linux-monitoring sensors), a free open source software-tool for Linux, provides tools and drivers for monitoring temperatures, voltage, and fans.<br />
<br />
== Special Note with Kernels >=2.6.31==<br />
A change in version 2.6.31 has made sensors stop working for some users. See [http://www.lm-sensors.org/wiki/FAQ/Chapter3#Mysensorshavestoppedworkinginkernel2.6.31 this FAQ question] for a detailed explanation and for some example errors. To fix sensors, add the following to your kernel boot line in /boot/grub/menu.lst and reboot your machine<br />
acpi_enforce_resources=lax<br />
<br />
Example from my system<br />
title Arch Linux<br />
root (hd0,1)<br />
kernel /boot/vmlinuz26 root=/dev/sda2 ro quiet acpi_enforce_resources=lax vga=773<br />
initrd /boot/kernel26.img<br />
<br />
== Usage ==<br />
=== Installation ===<br />
Install the sensors package from the main repo<br />
# pacman -S lm_sensors<br />
<br />
=== Setting up lm_sensors ===<br />
Use '''sensors-detect''' to detect and generate a list of kernel modules<br><pre># sensors-detect</pre>This will create the configuration and store it in {{Filename|/etc/conf.d/lm_sensors}}. Be sure you answer YES to the questions about probing various sensors. When the script is finished, you'll be presented with a summary of the probes, example from my system<br />
<pre>Now follows a summary of the probes I have just done.<br />
Just press ENTER to continue:<br />
Driver `it87':<br />
* ISA bus, address 0x290<br />
Chip `ITE IT8718F Super IO Sensors' (confidence: 9)<br />
Driver `coretemp':<br />
* Chip `Intel Core family thermal sensor' (confidence: 9)</pre><br />
Automatically load the kernel modules at boot time by adding '''sensors''' to the '''DAEMONS''' array in {{Filename|/etc/rc.conf}}<pre>DAEMONS=(syslog-ng crond ... sensors ...)</pre>Alternatively, manually add them to your '''MODULES''' array in {{Filename|/etc/rc.conf}} <pre>MODULES=(coretemp it87 acpi-cpufreq)</pre> You do '''NOT''' need both the DAEMONS setting and the MODULES setting.<br />
<br />
=== Testing your lm_sensors ===<br />
To test your setup, load the kernel modules manually or by using the sensors init script. You do '''NOT''' have to do both.<br />
Example manually adding them<br />
# modprobe it87<br />
# modprobe coretemp<br />
Example using the script<br />
# /etc/rc.d/sensors start<br />
<br />
You should see something like this when you run sensors<br />
<pre>$ sensors<br />
coretemp-isa-0000<br />
Adapter: ISA adapter<br />
Core 0: +30.0°C (high = +76.0°C, crit = +100.0°C) <br />
<br />
coretemp-isa-0001<br />
Adapter: ISA adapter<br />
Core 1: +30.0°C (high = +76.0°C, crit = +100.0°C) <br />
<br />
coretemp-isa-0002<br />
Adapter: ISA adapter<br />
Core 2: +32.0°C (high = +76.0°C, crit = +100.0°C) <br />
<br />
coretemp-isa-0003<br />
Adapter: ISA adapter<br />
Core 3: +30.0°C (high = +76.0°C, crit = +100.0°C) <br />
<br />
it8718-isa-0290<br />
Adapter: ISA adapter<br />
in0: +1.17 V (min = +0.00 V, max = +4.08 V) <br />
in1: +1.31 V (min = +1.28 V, max = +1.68 V) <br />
in2: +3.28 V (min = +2.78 V, max = +3.78 V) <br />
in3: +2.88 V (min = +2.67 V, max = +3.26 V) <br />
in4: +2.98 V (min = +2.50 V, max = +3.49 V) <br />
in5: +1.34 V (min = +0.58 V, max = +1.34 V) ALARM<br />
in6: +2.02 V (min = +1.04 V, max = +1.36 V) ALARM<br />
in7: +2.83 V (min = +2.67 V, max = +3.26 V) <br />
Vbat: +3.28 V<br />
fan1: 1500 RPM (min = 3245 RPM) ALARM<br />
fan2: 0 RPM (min = 3245 RPM) ALARM<br />
fan3: 0 RPM (min = 3245 RPM) ALARM<br />
temp1: +18.0°C (low = +127.0°C, high = +64.0°C) sensor = thermal diode<br />
temp2: +32.0°C (low = +127.0°C, high = +64.0°C) sensor = thermistor<br />
temp3: +38.0°C (low = +127.0°C, high = +64.0°C) sensor = thermistor<br />
cpu0_vid: +2.050 V<br />
<br />
acpitz-virtual-0<br />
Adapter: Virtual device<br />
temp1: +18.0°C (crit = +64.0°C)</pre><br />
<br />
=== Reading SPD values from memory modules (Optional) ===<br />
<br />
To read the SPD timing values from you memory modules, download this perl script:<br />
[http://www.lm-sensors.org/browser/lm-sensors/branches/lm-sensors-2.10/prog/eeprom/decode-dimms.pl?format=raw SPDdecodeScript]<br />
Once you have downloaded it, you will need to load the eeprom kernel module<br />
# modprobe eeprom<br />
Now can you make the decode-dimms.pl executable and run it<br />
$ chmod +x decode-dimms.pl<br />
Here is an example output from my machine<br />
<pre>$ ./decode-dimms.pl <br />
<br />
Memory Serial Presence Detect Decoder<br />
By Philip Edelbrock, Christian Zuckschwerdt, Burkart Lingner,<br />
Jean Delvare and others<br />
Version 2.10.8<br />
<br />
<br />
Decoding EEPROM: /sys/bus/i2c/drivers/eeprom/0-0050<br />
Guessing DIMM is in bank 1<br />
<br />
---=== SPD EEPROM Information ===---<br />
EEPROM Checksum of bytes 0-62 OK (0x0D)<br />
# of bytes written to SDRAM EEPROM 128<br />
Total number of bytes in EEPROM 256<br />
Fundamental Memory type DDR2 SDRAM<br />
SPD Revision 1.2<br />
<br />
---=== Memory Characteristics ===---<br />
Maximum module speed 800MHz (PC2-6400)<br />
Size 2048 MB<br />
tCL-tRCD-tRP-tRAS 5-5-5-18<br />
Supported CAS Latencies 5, 4<br />
Minimum Cycle Time (CAS 5) 2.5 ns<br />
Maximum Access Time (CAS 5) 0.4 ns<br />
Minimum Cycle Time (CAS 4) 3.7 ns<br />
Maximum Access Time (CAS 4) 0.5 ns<br />
<br />
---=== Manufacturing Information ===---<br />
Manufacturer Corsair<br />
Manufacturing Location Code 0x01<br />
Part Number CM2X2048-8500C5D <br />
Revision Code 0x2020<br />
<br />
<br />
Decoding EEPROM: /sys/bus/i2c/drivers/eeprom/0-0051<br />
Guessing DIMM is in bank 2<br />
<br />
---=== SPD EEPROM Information ===---<br />
EEPROM Checksum of bytes 0-62 OK (0x0D)<br />
# of bytes written to SDRAM EEPROM 128<br />
Total number of bytes in EEPROM 256<br />
Fundamental Memory type DDR2 SDRAM<br />
SPD Revision 1.2<br />
<br />
---=== Memory Characteristics ===---<br />
Maximum module speed 800MHz (PC2-6400)<br />
Size 2048 MB<br />
tCL-tRCD-tRP-tRAS 5-5-5-18<br />
Supported CAS Latencies 5, 4<br />
Minimum Cycle Time (CAS 5) 2.5 ns<br />
Maximum Access Time (CAS 5) 0.4 ns<br />
Minimum Cycle Time (CAS 4) 3.7 ns<br />
Maximum Access Time (CAS 4) 0.5 ns<br />
<br />
---=== Manufacturing Information ===---<br />
Manufacturer Corsair<br />
Manufacturing Location Code 0x01<br />
Part Number CM2X2048-8500C5D <br />
Assembly Serial Number 0x00514458<br />
<br />
<br />
Decoding EEPROM: /sys/bus/i2c/drivers/eeprom/0-0052<br />
Guessing DIMM is in bank 3<br />
<br />
---=== SPD EEPROM Information ===---<br />
EEPROM Checksum of bytes 0-62 OK (0x0D)<br />
# of bytes written to SDRAM EEPROM 128<br />
Total number of bytes in EEPROM 256<br />
Fundamental Memory type DDR2 SDRAM<br />
SPD Revision 1.2<br />
<br />
---=== Memory Characteristics ===---<br />
Maximum module speed 800MHz (PC2-6400)<br />
Size 2048 MB<br />
tCL-tRCD-tRP-tRAS 5-5-5-18<br />
Supported CAS Latencies 5, 4<br />
Minimum Cycle Time (CAS 5) 2.5 ns<br />
Maximum Access Time (CAS 5) 0.4 ns<br />
Minimum Cycle Time (CAS 4) 3.7 ns<br />
Maximum Access Time (CAS 4) 0.5 ns<br />
<br />
---=== Manufacturing Information ===---<br />
Manufacturer Corsair<br />
Manufacturing Location Code 0x01<br />
Part Number CM2X2048-8500C5D <br />
Revision Code 0x2020<br />
<br />
<br />
Decoding EEPROM: /sys/bus/i2c/drivers/eeprom/0-0053<br />
Guessing DIMM is in bank 4<br />
<br />
---=== SPD EEPROM Information ===---<br />
EEPROM Checksum of bytes 0-62 OK (0x0D)<br />
# of bytes written to SDRAM EEPROM 128<br />
Total number of bytes in EEPROM 256<br />
Fundamental Memory type DDR2 SDRAM<br />
SPD Revision 1.2<br />
<br />
---=== Memory Characteristics ===---<br />
Maximum module speed 800MHz (PC2-6400)<br />
Size 2048 MB<br />
tCL-tRCD-tRP-tRAS 5-5-5-18<br />
Supported CAS Latencies 5, 4<br />
Minimum Cycle Time (CAS 5) 2.5 ns<br />
Maximum Access Time (CAS 5) 0.4 ns<br />
Minimum Cycle Time (CAS 4) 3.7 ns<br />
Maximum Access Time (CAS 4) 0.5 ns<br />
<br />
---=== Manufacturing Information ===---<br />
Manufacturer Corsair<br />
Manufacturing Location Code 0x01<br />
Part Number CM2X2048-8500C5D <br />
Assembly Serial Number 0x00514458<br />
<br />
<br />
Decoding EEPROM: /sys/bus/i2c/drivers/eeprom/0-0057<br />
Guessing DIMM is in bank 8<br />
<br />
---=== SPD EEPROM Information ===---<br />
EEPROM Checksum of bytes 0-62 Bad<br />
(found 0x20, calculated 0x0A)<br />
<br />
<br />
Number of SDRAM DIMMs detected and decoded: 4</pre><br />
<br />
== Using sensor data ==<br />
=== Graphical Frontends ===<br />
There are a variety of front-ends for sensors data. Some are listed below. The name in ''italicized text'' is the name of the package in the repo, in other words, you can install them via pacman.<br />
<br />
#''sensors-applet'' - an applet for the GNOME Panel to display readings from hardware sensors, including CPU temperature, fan speeds and voltage readings.<br />
#''ksensors'' - ksensors is nice lm_sensors frontend for KDE<br />
#''xsensors'' - X11 interface to lm_sensors<br />
#''xfce4-sensors-plugin'' - A lm_sensors plugin for the Xfce panel<br />
#''[[conky]]'' - Conky is an advanced, highly configurable system monitor for X based on torsmo<br />
=== Sensord ===<br />
There is an optional daemon logging package called sensord that can log your data to a round robin database (rrd) that you can visualize graphically. Placeholder for someone to write a wiki page on installation/configuration of [[sensord]].</div>Pwdhttps://wiki.archlinux.org/index.php?title=Colored_Pacman_output&diff=90585Colored Pacman output2010-01-01T13:45:59Z<p>Pwd: fx redir</p>
<hr />
<div>#REDIRECT[[Pacman Tips#Color output]]</div>Pwdhttps://wiki.archlinux.org/index.php?title=HP_Pavilion_dv2-1030us&diff=89536HP Pavilion dv2-1030us2009-12-30T22:49:56Z<p>Pwd: add ln to ALSA</p>
<hr />
<div>[[Category:HP_(English)]] [[Category:HOWTOs_(English)]]<br />
Although I have only owned this laptop for a short time, I am very pleased with it. Initally I went for a dual boot, since I figured linux might not have the best driver support for the hardware which is very new. However, I was plesantly surprised to find that with a bit of work, nearly all features can be made to work correctly. As of now I have not tested the HDMI out, or the webcam. So I have not detailed their setup or even have an idea if they work. The only downside I am seeing to this laptop thusfar is that the battery does not last too long. Oh and by contrast, if you were planning on dual booting XP with this, don't. Good ol' Win XP does not have any drivers for the ethernet, wireless, audio, or video. <br />
<br />
==Hardware Details==<br />
<br />
===Output from 'lspci -k'===<br />
00:00.0 Host bridge: ATI Technologies Inc RS690 Host Bridge<br />
Subsystem: Hewlett-Packard Company Device 3055<br />
Kernel modules: ati-agp<br />
00:02.0 PCI bridge: ATI Technologies Inc RS690 PCI to PCI Bridge (PCI Express Graphics Port 0)<br />
Kernel driver in use: pcieport-driver<br />
Kernel modules: shpchp<br />
00:06.0 PCI bridge: ATI Technologies Inc RS690 PCI to PCI Bridge (PCI Express Port 2)<br />
Kernel driver in use: pcieport-driver<br />
Kernel modules: shpchp<br />
00:07.0 PCI bridge: ATI Technologies Inc RS690 PCI to PCI Bridge (PCI Express Port 3)<br />
Kernel driver in use: pcieport-driver<br />
Kernel modules: shpchp<br />
00:12.0 SATA controller: ATI Technologies Inc SB600 Non-Raid-5 SATA<br />
Subsystem: Hewlett-Packard Company Device 3055<br />
Kernel driver in use: ahci<br />
Kernel modules: ahci<br />
00:13.0 USB Controller: ATI Technologies Inc SB600 USB (OHCI0)<br />
Subsystem: Hewlett-Packard Company Device 3055<br />
Kernel driver in use: ohci_hcd<br />
Kernel modules: ohci-hcd<br />
00:13.1 USB Controller: ATI Technologies Inc SB600 USB (OHCI1)<br />
Subsystem: Hewlett-Packard Company Device 3055<br />
Kernel driver in use: ohci_hcd<br />
Kernel modules: ohci-hcd<br />
00:13.2 USB Controller: ATI Technologies Inc SB600 USB (OHCI2)<br />
Subsystem: Hewlett-Packard Company Device 3055<br />
Kernel driver in use: ohci_hcd<br />
Kernel modules: ohci-hcd<br />
00:13.3 USB Controller: ATI Technologies Inc SB600 USB (OHCI3)<br />
Subsystem: Hewlett-Packard Company Device 3055<br />
Kernel driver in use: ohci_hcd<br />
Kernel modules: ohci-hcd<br />
00:13.4 USB Controller: ATI Technologies Inc SB600 USB (OHCI4)<br />
Subsystem: Hewlett-Packard Company Device 3055<br />
Kernel driver in use: ohci_hcd<br />
Kernel modules: ohci-hcd<br />
00:13.5 USB Controller: ATI Technologies Inc SB600 USB Controller (EHCI)<br />
Subsystem: Hewlett-Packard Company Device 3055<br />
Kernel driver in use: ehci_hcd<br />
Kernel modules: ehci-hcd<br />
00:14.0 SMBus: ATI Technologies Inc SBx00 SMBus Controller (rev 14)<br />
Subsystem: Hewlett-Packard Company Device 3055<br />
Kernel driver in use: piix4_smbus<br />
Kernel modules: i2c-piix4<br />
00:14.1 IDE interface: ATI Technologies Inc SB600 IDE<br />
Subsystem: Hewlett-Packard Company Device 3055<br />
Kernel driver in use: pata_atiixp<br />
Kernel modules: pata_atiixp, atiixp<br />
00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia (Intel HDA)<br />
Subsystem: Hewlett-Packard Company Device 3055<br />
Kernel driver in use: HDA Intel<br />
Kernel modules: snd-hda-intel<br />
00:14.3 ISA bridge: ATI Technologies Inc SB600 PCI to LPC Bridge<br />
Subsystem: Hewlett-Packard Company Device 3055<br />
00:14.4 PCI bridge: ATI Technologies Inc SBx00 PCI to PCI Bridge<br />
00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration<br />
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map<br />
00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller<br />
00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control<br />
Kernel driver in use: k8temp<br />
Kernel modules: k8temp<br />
01:00.0 VGA compatible controller: ATI Technologies Inc Mobility Radeon HD 3400 Series<br />
Subsystem: Hewlett-Packard Company Device 3055<br />
Kernel driver in use: fglrx_pci<br />
Kernel modules: fglrx<br />
01:00.1 Audio device: ATI Technologies Inc RV620 Audio device [Radeon HD 34xx Series]<br />
Subsystem: ATI Technologies Inc RV620 Audio device [Radeon HD 34xx Series]<br />
Kernel driver in use: HDA Intel<br />
Kernel modules: snd-hda-intel<br />
02:00.0 Network controller: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller (rev 01)<br />
Subsystem: Hewlett-Packard Company Device 1509<br />
Kernel driver in use: wl<br />
Kernel modules: wl<br />
08:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)<br />
Subsystem: Hewlett-Packard Company Device 3055<br />
Kernel driver in use: r8169<br />
Kernel modules: r8169<br />
<br />
===Output from 'lsusb'===<br />
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 001 Device 004: ID 0bda:0158 Realtek Semiconductor Corp. Mass Stroage Device<br />
Bus 001 Device 003: ID 0c45:62c0 Microdia Sonix USB 2.0 Camera<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
<br />
==Setup==<br />
<br />
===Grub and Framebuffer Modes===<br />
Not all framebuffer modes are curretly supported by this hardware. For example the argument <tt>vga=773</tt> that I would normally add to the kernel line of the grub menu.lst, gives strange and terrible results. Also, the 32bit 1024x768 mode does not work at all. I would suggest that you use <tt>vga=791</tt> (64K colors @ 1024x768) for the framebuffer mode if you decide to use one.<br />
<br />
===Audio===<br />
Initially I was having some serious problems getting this working. After you get [[ALSA]] installed, it will likely detect several different sound cards. Use <br />
cat /proc/asound/cards <br />
to get a printout of what cards are available. You then need to use the following command to modify the sound levels on the appropriate card from the list<br />
alsamixer -c# <br />
but replace the pound sign with the number corresponding to the appropriate card (HDA ATI SB). Be sure to unmute both the headphone and speaker channel. Also, don't forget to add alsa to the daemons section of the rc.conf. The integrated speakers sound very good and are actually quite loud, enjoy. <br />
<br />
===Wireless===<br />
The wireless card in this computer is a BCM4322. You can follow the instructions [[Broadcom BCM4312|here]], to set up wireless networking. Also like the page says, the wireless interface will be named 'eth0', so dont be surpised.<br />
<br />
*Update (08.23.09) -- Ever since updating to kernel26 2.6.30.5-1 my wireless card stopped working. After cross referencing some driver and module settings with my backup ubuntu install, I determined that arch was now auto loading the 'b43' and 'ssb' module and using them instead of the 'wl' driver. To make your wireless card work again, you will need to blacklist the 'b43' and 'ssb' modules in your rc.conf like so.<br />
MODULES=(powernow-k8 ... !ssb !b43 lib80211_crypt_tkip wl)<br />
After changing this, just restart your system and wireless should be working again.<br />
<br />
===Graphics===<br />
I started out using the radeonhd drivers but I was only getting around 170fps from glxgears and since this has discrete graphics that seems a bit underpar. So I switched over to the proprietary catalyst drivers. Now that these drivers are in the AUR they are slightly more annoying to set up, but not intolerable. The setup is exactly as described on the [[ATI]] page. I would highly reccomend looking into installing yaourt if you intend to maintain such a system. Yaourt will make the process of building packages from the AUR almost completely painless. With the catalyst driver in place glxgears is giving me ~2500fps, not too bad for an inexpensive ultraportable if you ask me.<br />
<br />
*Update (08.04.09) -- As everybody already knows, the quality of the catalyst drivers are horrible. The catalyst 9.6 drivers would not work at all with the video card in this system. The 9.7 drivers will actually work, but for i686 systems it currently requires that a kernel patch be applied. For some strange reason the x86_64 version of the drivers do not need that, patch but still have their own quirks.<br />
<br />
*Update (08.23.09) -- The catalyst 9.8 driver is out, it works on x86_64 without a hassle, however it is still producing lackluster perfomance on the only game which I would have been playing, savage. The last version of this driver that actually worked well was the 9.5 catalyst driver... if you can't get that version of the driver, you should expect bad performance on this hardware. Sorry guys.</div>Pwdhttps://wiki.archlinux.org/index.php?title=User_talk:Totalwormage&diff=89496User talk:Totalwormage2009-12-30T21:28:45Z<p>Pwd: thanks for working w/i18n</p>
<hr />
<div>==Wrong categories==<br />
Those categories shouldn't be member of the HOWTOs cat. File system, for example, should be member of Software, as per the [[Table of Contents (English)]] page. Why are you including them into HOWTO? <small>[[User:Pwd|pwd]]</small> 11:22, 30 December 2009 (EST)<br />
<br />
i'm blindly moving pages that belonged to 'HowTos' to 'HOWTOs', assuming they belong there. (should i reply here?) [[User:Totalwormage|totalwormage]] 11:24, 30 December 2009 (EST)<br />
<br />
:Some pages do belong in HOWTO, but ''categories'' do not. See the table of contents I linked to; this has the category structure laid out already. <small>[[User:Pwd|pwd]]</small> 11:28, 30 December 2009 (EST)<br />
<br />
:: kk, thanks! [[User:Totalwormage|totalwormage]] 11:29, 30 December 2009 (EST)<br />
<br />
==Thanks==<br />
Good job improving intl. cats! By the way, are you using a bot? ;) <small>[[User:Pwd|pwd]]</small> 16:28, 30 December 2009 (EST)</div>Pwdhttps://wiki.archlinux.org/index.php?title=Samsung_N120&diff=89436Samsung N1202009-12-30T19:30:52Z<p>Pwd: add ln to Intel Graphics</p>
<hr />
<div>[[Category:Samsung (English)]] [[Category:Getting and installing Arch (English)]] [[Category:HOWTOs (English)]]<br />
<br />
This article aims on providing the informations on installing and setting up Arch Linux on the Samsung N120. Basically I used information from [[Samsung NC10]] netbook wiki.<br />
<br />
A lot of the information is derived from the [http://bbs.archlinux.org/viewtopic.php?id=58117 NC10 Arch Forum] and [http://bbs.archlinux.org/viewtopic.php?id=77218 N120 Arch Forum] and several hints scattered around in the ArchWiki.<br />
<br />
=Prior to Installation, Common Issues You Should Be Aware Of=<br />
<br />
* Installation from USB flash works after you add acpi=off to the kernel parameters.<br />
* On kernel 2.6.30 webcam is working but not for Skype, but with kernel 2.6.31 from testing repository it works (with LD_PRELOAD trick, i.e. start skype in the following way: $LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so /usr/bin/skype or write your own bash script)<br />
* Suspend to RAM and Suspend to Disk works perfectly on 2.6.30 and 2.6.31<br />
* AFAIK, there is no known good way to map Fn+(up/down) for controlling brightness. Everything else can be mapped through xbindkeys or using trick from ubuntu wiki (below).<br />
<br />
=Installation=<br />
<br />
You can use the usb image provided at the official download locations or the iso, if you have an external optical drive. If installation fails try to add acpi=off to the kernel parameters.<br />
<br />
=Configure your installation=<br />
<br />
==Network==<br />
<br />
Should work out-of-the-box now. WLAN uses the ath5k module and LAN, sky2.<br />
<br />
==Video==<br />
<br />
==Initial Brightness==<br />
The full brightness can be set with the following command<br />
<br />
setpci -s 00:02.1 F4.B=FF<br />
<br />
where FF is the highest level of brightness. That parameter moves in the range 00..FF. Don't set it too low because your backlight will turn off! I tried different parameters and optimal are F.4B=45 or F.4B=50. I added setpci -s 00:02.1 F4.B=40 to my /etc/rc.local.<br />
<br />
==Graphics Adapter==<br />
The Video controller is a typical [[Intel Graphics]] chipset that works with the xf86-video-intel driver (or xf86-video-intel-new from AUR)<br />
<br />
To save some interrupts and therefore power you can disable dri in your xorg.conf. This disables 3D effects but if you don't need them this could be an option.<br />
Section "Device"<br />
Option "NoDRI"<br />
Identifier "Card0"<br />
Driver "intel"<br />
VendorName "Intel Corporation"<br />
BoardName "Mobile 945GME Express Integrated Graphics Controller"<br />
BusID "PCI:0:2:0"<br />
EndSection<br />
<br />
===External VGA===<br />
External VGA works out of the box with xrandr<br />
<br />
in order to prevent problems when switching to console or when unplugging the external monitor, make sure to specify the frequency along with the mode, for example :<br />
<br />
xrandr --output VGA --mode 1280x1024 --rate 60<br />
<br />
You can also use randr frontend, lxrandr for example.<br />
<br />
Dual head positioning works also perfectly : [[Xorg#Multi-monitor_setups]]<br />
<br />
==Audio==<br />
The audio device is an Intel HD. Since alsa 1.0.19 distributed in archlinux extra repository, you don't need to manually install alsa driver. Everything is working out of the box: onboard microphone and speakers, audio off on earphone plugging.<br />
<br />
'''Troubleshooting :'''<br />
<br />
* If the volume is too low, or lower than in Windows run alsamixer, and set "front" to 100%.<br />
<br />
* If the microphone does not work, press F4 in alsamixer and play with the settings (boost to 0, digital and capture to mid-values, and input to front-mic should be a sane default).<br />
<br />
Note that settings can be saved with "alsactl store"<br />
<br />
* One user reported that he had to disable every snd module in his rc.conf except for two: snd_hda_intel and snd_pcm_oss.<br />
<br />
* [deprecated] if the speakers don't mute when you plug in headphones, you may need to compile alsa.<br />
<br />
Download latest alsa build. Extract the tar.bz2 and open a console on alsa source folder<br />
<br />
1.execute this command : ./configure --with-cards=hda-intel --with-oss=yes --with-sequencer=yes<br />
2.execute this command : make<br />
3.execute this command : sudo make install<br />
4.get alsa-utils with pacman<br />
5.configure sound volume with alsamixer , reboot , and enjoy :)<br />
<br />
==Suspend and Hibernate==<br />
Pm-suspend should work correctly without any quirks at the moment.<br />
<br />
You can use this command not only to suspend from terminal but also in combination with [[acpid]]<br />
<br />
If after closing the lid your machine doesn't wake up from suspend correctly and needs to be resumed multiple times, you can try using the following workaround. This is an excerpt from /etc/acpid/handler.sh file:<br />
button/lid)<br />
if [ `/bin/awk '{print $2}' /proc/acpi/button/lid/LID0/state` = closed ]; then<br />
/usr/sbin/pm-suspend<br />
fi<br />
;;<br />
<br />
In contrast hibernate works without "modifications" (except the ones mentioned in the [[pm-utils|pm-utils article]]).<br />
<br />
If you are a kde4/kdemod user you can take advantage of powerdevil (included in kdemod-core/kdemod-kdebase-workspace since release 4.2). Screen brightness, cpu scaling, suspend and hibernate all work flawlessly, without any hack.<br />
<br />
Right after resume you may notice (i.e. in powertop) lost support for C2 and C4 CPU states. Don't panic. Those modes are likely to return in several minutes.<br />
<br />
==Fn Keys==<br />
You need at least kernel 2.6.28.4 to get the Fn keys to work correctly.<br />
<br />
(Volume Controls worked out of the box in kdemod 4.2)<br />
<br />
To bind the Fn keys to action, read [[Extra_Keyboard_Keys#The_quick_way]] and also [[Extra_Keyboard_Keys_in_Xorg#Using_your_Desktop_Environment_tools|Extra Keyboard Keys in Xorg]]. The suspend key (Fn+ESC) and disable touchpad (Fn+F10) keys should work out of the box. Note, that suspend key is handled in /etc/acpi/handler.sh (see "power/sleep" case entry). If you use pm-utils, you should substitute the default action with the call to pm-suspend or pm-hibernate.<br />
<br />
This tweak taken from [https://help.ubuntu.com/community/NC10 Ubuntu wiki]. To get volume and brightness Fn keys work in Gnome you have to make sure that gnome-power-manager is running and add ";N120" to the list of Samsung models in /usr/share/hal/fdi/information/10freedesktop/30-keymap-misc.fdi, i.e.<br />
<br />
<match key="/org/freedesktop/Hal/devices/computer:system.hardware.product" <br />
contains_outof="SP55S;SQ45S70S;SX60P;R59P/R60P/R61P;Q310;X05"><br />
<br />
becomes<br />
<br />
<match key="/org/freedesktop/Hal/devices/computer:system.hardware.product" <br />
contains_outof="SP55S;SQ45S70S;SX60P;R59P/R60P/R61P;Q310;X05;N120"><br />
<br />
<br />
Also you can play with xbindkey. As an example, here is how to bind the keys for volume control :<br />
<br />
1) install ''xbindkeys'' (and ''xbacklight'' from package ''xorg-server-utils'' for brightness control):<br />
pacman -S xbindkeys xorg-server-utils<br />
<br />
2) crate a config file in your home directory :<br />
vi .xbindkeysrc<br />
<br />
3) with the following content :<br />
"amixer sset Master 2+ &"<br />
m:0x0 + c:176<br />
"amixer sset Master 2- &"<br />
m:0x0 + c:174<br />
#"amixer sset Master 0 &"<br />
"amixer sset Master toggle &"<br />
m:0x0 + c:160<br />
#"sudo pm-suspend"<br />
# m:0x0 + c:223<br />
"xbacklight +10"<br />
m:0x0 + c:233<br />
"xbacklight -10"<br />
m:0x0 + c:232<br />
For your NC10 Fn keysums may differ. If any Fn keys don't work with the above .xbindkeysrc, you should check the keysum values with<br />
xbindkeys -k<br />
<br />
4) run xbindkeys :<br />
xbindkeys<br />
and volume control should work within an X session !<br />
<br />
to add aditional bindings, you can get the codes of most of the Fn-keys with <br />
xbindkeys -k<br />
<br />
For the keys that are not recongnized, see <br />
dmesg |tail<br />
to make the kernel recognize them.<br />
<br />
(If your Screen is not bright enough, boot into Windows and set the Brightness to maximum)<br />
<br />
(you can adjust Brightness during the boot process without returning into Windows and you need to set maximum brightness on battery only mode)<br />
<br />
Alternatively, you can add needed broghtness level on the boot, simply add line setpci -s 00:02.1 F4.B=FF (00..FF) to your /etc/rc.local.<br />
<br />
==Saving Power==<br />
Make sure to read [[Laptop#Suggestions_for_saving_power]]<br />
<br />
Here is a suggestion of things to add to /etc/rc.local to save some power, most of which are suggestions from "powertop".<br />
<br />
# /etc/rc.n120: various init and power saving stuff for samsung n120.<br />
# <br />
# avoid too many power up/down of hard drive, taken over by laptop-mode-tools anyway<br />
hdparm -B 255 /dev/sda<br />
<br />
#disable bluetooth <br />
#(alternatively you can disable bluetooth in rc.conf: MODULES=(... !btusb ...))<br />
hciconfig hci0 down ; rmmod btusb<br />
<br />
# enables on-demand cpu freq scaling (requires cpufreq modules) :<br />
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor<br />
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor<br />
<br />
### turn off wifi<br />
# ifconfig wmaster0 down<br />
# echo "wifi is shut down"<br />
# You can also disable wifi module in /etc/rc.conf: MODULES=(.. !ath5k ...)<br />
# or <br />
rmmod ath5k<br />
<br />
#The pdflush writeback daemons will periodically wake up and <br />
#write "old" data out to disk. This tunable expresses <br />
#the interval between those wakeups, in 100'ths of a second.<br />
#Setting this to zero disables periodic writeback altogether.<br />
echo "1500"| tee -a /proc/sys/vm/dirty_writeback_centisecs<br />
<br />
#dirty_ratio contains, as a percentage of total system memory, <br />
#the number of pages at which a process which is generating <br />
#disk writes will itself start writing out dirty data.<br />
#echo "20"| tee -a /proc/sys/vm/dirty_ratio<br />
<br />
#dirty_background_ratio Contains, as a percentage of total system memory, <br />
#the number of pages at which the pdflush background <br />
#writeback daemon will start writing out dirty data.<br />
#echo "10"| tee -a /proc/sys/vm/dirty_background_ratio<br />
<br />
#Not sure<br />
#echo "1"| tee -a /sys/devices/system/cpu/sched_smt_power_savings<br />
<br />
#The value of the laptop_mode knob determines the time between the <br />
#occurrence of disk I/O and when the flush is triggered. <br />
#A sensible value for the knob is 5 seconds. <br />
#Setting the knob to 0 disables laptop mode.<br />
echo "5" | tee -a /proc/sys/vm/laptop_mode<br />
<br />
# CPU undervolting<br />
echo "12:24 10:20 8:15 6:15"| tee -a /sys/devices/system/cpu/cpu0/cpufreq/phc_controls<br />
echo "12:24 10:20 8:15 6:15"| tee -a /sys/devices/system/cpu/cpu1/cpufreq/phc_controls<br />
<br />
# autosuspend webcamera ****does this really work ????****<br />
echo "auto" | tee -a /sys/bus/usb/devices/1-8/power/level<br />
echo "1" | tee -a /sys/bus/usb/devices/1-8/power/autosuspend<br />
<br />
## sound chip power save mode<br />
## => disabled because it makes some high frenquency noise...<br />
#echo "10" | tee -a /sys/module/snd_hda_intel/parameters/power_save<br />
<br />
#Set initial brightness level<br />
#setpci -s 00:02.1 F4.B=50<br />
setpci -s 00:02.1 F4.B=35<br />
<br />
<br />
<br />
<br />
Use laptop-mode-tools<br />
pacman -S laptop-mode-tools<br />
and configure it to suit your needs in /etc/laptop-mode/laptop-mode.conf<br />
Here again some suggestions :<br />
<br />
#turn off hard-drive after 10min on AC and 2min on battery (prevents freezes when accessing hd often)<br />
LM_AC_HD_IDLE_TIMEOUT_SECONDS=600<br />
LM_BATT_HD_IDLE_TIMEOUT_SECONDS=120<br />
NOLM_HD_IDLE_TIMEOUT_SECONDS=1800<br />
<br />
CONTROL_HD_POWERMGMT=1<br />
<br />
# prevents too many parking of heads while still saving some power on battery.<br />
BATT_HD_POWERMGMT=254<br />
LM_AC_HD_POWERMGMT=255<br />
NOLM_AC_HD_POWERMGMT=255</div>Pwdhttps://wiki.archlinux.org/index.php?title=HP_Mini_5101&diff=89430HP Mini 51012009-12-30T17:35:49Z<p>Pwd: change hardlinks to ALSA and Bluetooth</p>
<hr />
<div>[[Category:HP (English)]] [[Category:HOWTOs (English)]]<br />
== Hardware ==<br />
<br />
=== Video ===<br />
<br />
Intel stable drivers ([http://aur.archlinux.org/packages.php?ID=28184 xf86-video-intel-stable]) from AUR will give you 250-290 FPS on glxgears.<br />
<br />
=== Audio ===<br />
<br />
Typical Intel HD Audio. Just follow [[ALSA]].<br />
<br />
Make sure you have the latest version of alsa-utils, alsa-lib and alsa-firmware.<br />
<br />
=== Touchpad ===<br />
<br />
Works out of the box. (Guess it's because of HAL)<br />
<br />
=== Network ===<br />
<br />
Swapping eth0/eth1 can confuse [[Wicd]], assigning static names [http://wiki.archlinux.org/index.php/Udev#Mixed_Up_Devices.2C_Sound.2FNetwork_Cards_Changing_Order_Each_Boot helps].<br />
<br />
==== Broadcom (Wireless) Driver ====<br />
<br />
$ lspci | grep Broadcom<br />
08:00.0 Network controller: Broadcom Corporation Device 4353 (rev 01)<br />
<br />
Using [http://aur.archlinux.org/packages.php?ID=19514 broadcom-wl] from AUR will do the trick.<br />
<br />
It may be necessary to load the driver manually:<br />
{{file |name=/etc/rc.conf |content=MODULES=(... wl ...)<br />
}}<br />
<br />
=== Bluetooth ===<br />
<br />
See: [[Bluetooth]]<br />
<br />
=== ACPI ===<br />
<br />
==== Suspend on Lid ====<br />
<br />
This here works quite fine: [[Suspend to RAM#Automatic Suspend, the Hard Way]]<br />
<br />
It might be necessary to use "/etc/acpi/events/lm_lid" instead of "/etc/acpi/events/lid". (laptop-mode?)<br />
<br />
Just change the "LID" to it's actual value. For me it was C1D0.<br />
<br />
{{file |name=/etc/acpi/actions/lid_handler.sh|content=<nowiki><br />
if grep closed /proc/acpi/button/lid/</nowiki>'''C1D0'''<nowiki>/state >/dev/null ; then </nowiki>}}<br />
<br />
==== Power Button ====<br />
<br />
http://wiki.archlinux.org/index.php/Shutting_system_down_by_pressing_the_power_button<br />
<br />
==== Hotkeys ====<br />
<br />
===== Display toggle =====<br />
<br />
http://wiki.archlinux.org/index.php/ACPI_hotkeys<br />
<br />
# acpi_listen<br />
(Press fn+f2)<br />
video C088 00000080 00000000<br />
So we have to edit<br />
/etc/acpi/handler.sh<br />
like this<br />
{{file |name=/etc/acpi/handler.sh |content=<br />
case "$1" in<br />
.<br />
.<br />
.<br />
video)<br />
arandr #or path to your shell script for switching display mode<br />
;;<br />
.<br />
.<br />
.<br />
esac<br />
}}<br />
<br />
===== Mute, browser button, volume down, etc... =====<br />
<br />
http://wiki.archlinux.org/index.php/Extra_Keyboard_Keys</div>Pwdhttps://wiki.archlinux.org/index.php?title=Fujitsu_Siemens_Lifebook_P7010&diff=89419Fujitsu Siemens Lifebook P70102009-12-30T16:50:56Z<p>Pwd: add link to Wireless and X</p>
<hr />
<div>[[Category:Fujitsu (English)]] [[Category:HOWTOs (English)]]<br />
The Fujitsu-Siemens P7010(D) is a neat little laptop with a 10" widescreen. It weighs little more than a kilo, has a relatively long battery life and sports many things that low-weight laptops normally lack.<br />
<br />
==Overview==<br />
===System Specifications===<br />
<br />
Fujitsu Siemens LifeBook P7010 - Pentium M 753 1.2 GHz - 10.6" TFT<br />
* 26.1 cm x 19.9 cm x 3.5 cm<br />
* 1.3 kg<br />
* Pentium M 753 1.2 GHz ULV, 2MB L2-cache<br />
* 512MB DDR SDRAM 333MHz PC2700 (maximum: 1024MB)<br />
* SD-card reader (ricoh)<br />
* CF reader<br />
* PCMCIA<br />
* 80GB 5400 rpm Harddrive<br />
* 10.6" TFT active matrix WXGA (1280 x 768)<br />
* Intel 855GME<br />
* Ethernet<br />
* Intel PRO/Wireless 2200BG<br />
* Modem<br />
* 2 USB ports, 1 firewire<br />
* Battery time: 7.5 hours<br />
* Port for external screen<br />
* TV-out<br />
* 1 modular bay (I've filled it out with a DVD-burner(MATSHITADVD-RAM UJ-822S)<br />
<br />
Output of lshwd<br />
00:00.0 Host bridge: Intel Corp.: Unknown device 3580 (intel-agp)<br />
00:00.1 System peripheral: Intel Corp.: Unknown device 3584 (unknown)<br />
00:00.3 System peripheral: Intel Corp.: Unknown device 3585 (unknown)<br />
00:02.0 VGA compatible controller: Intel Corp.: Unknown device 3582 (vesa)<br />
00:02.1 Display controller: Intel Corp.: Unknown device 3582 (vesa)<br />
00:1d.0 USB Controller: Intel Corp. 82801DB USB (Hub #1) (uhci_hcd)<br />
00:1d.1 USB Controller: Intel Corp. 82801DB USB (Hub #2) (uhci_hcd)<br />
00:1d.7 USB Controller: Intel Corp. 82801DB USB EHCI Controller (ehci-hcd)<br />
00:1e.0 PCI bridge: Intel Corp. 82801BAM/CAM PCI Bridge (hw_random)<br />
00:1f.0 ISA bridge: Intel Corp.: Unknown device 24cc (unknown)<br />
00:1f.1 IDE interface: Intel Corp.: Unknown device 24ca (piix)<br />
00:1f.3 SMBus: Intel Corp. 82801DB SMBus (i2c-i801)<br />
00:1f.5 Multimedia audio controller: Intel Corp. 82801DB AC'97 Audio (snd-intel8x0)<br />
00:1f.6 Modem: Intel Corp. 82801DB AC'97 Modem (slamr)<br />
01:0a.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (yenta_socket)<br />
01:0a.1 CardBus bridge: Ricoh Co Ltd RL5c476 II (yenta_socket)<br />
01:0a.2 FireWire (IEEE 1394): Ricoh Co Ltd R5C552 IEEE 1394 Controller (ohci1394)<br />
01:0a.3 System peripheral: Ricoh Co Ltd: Unknown device 0576 (unknown)<br />
01:0a.4 System peripheral: Ricoh Co Ltd: Unknown device 0592 (unknown)<br />
01:0c.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (8139too)<br />
01:0d.0 Network controller: Intel Corp.: Unknown device 4220 (ipw2200)<br />
003:003 USB Mass Storage: FireWire/USB2.0 Combo (usb-storage)<br />
003:001 USB Hub: (hub)<br />
002:001 USB Hub: (hub)<br />
001:002 USB Wireless: USAWireless Bluetooth Device (hci_usb)<br />
001:001 USB Hub: (hub)<br />
---:--- Mouse: Generic PS/2 Wheel Mouse [/dev/psaux] (msintellips/2)<br />
<br />
===What works/What doesn't===<br />
Pretty much everything works on this laptop except the TV-out and the SD-card reader. The screen needs a little tweaking to get working. The preferred resolution (1280x768) isn't part of the VBIOS, and consequently the VBIOS needs to be patched with Alain Poirier's software 855resolution (to be found in the AUR). <br />
<br />
==Video==<br />
{{sn|relevant modules:<br />
* intel-agp <br />
* i915}}<br />
<br />
In order to get the video working fine at 1280x768 you need to patch the VBIOS with Alain Poirier's 855resolution for which there is a [http://aur.archlinux.org/packages.php?do_Details=1&ID=1672&O=0&L=&C=&K=&SB=&PP=&do_MyPackages=&do_Orphans= PKGBUILD] in the AUR. This application allows you to replace any of the modes in the VBIOS with something else. After you've compiled the package and installed it, run the following command.<br />
855resolution 5c 1280 768<br />
<br />
This will replace mode 5c with 1280 768. You can list the modes with<br />
855resolution -l<br />
which should return something like this:<br />
855resolution version 0.4, by Alain Poirier<br />
<br />
Chipset: 855GM (id=0x35808086)<br />
VBIOS type: 2<br />
VBIOS Version: 3181 <br />
<br />
Mode 30 : 640x480, 8 bits/pixel<br />
Mode 32 : 800x600, 8 bits/pixel<br />
Mode 34 : 1024x768, 8 bits/pixel<br />
Mode 38 : 1280x1024, 8 bits/pixel<br />
Mode 3a : 1600x1200, 8 bits/pixel<br />
Mode 3c : 1280x768, 8 bits/pixel<br />
Mode 41 : 640x480, 16 bits/pixel<br />
Mode 43 : 800x600, 16 bits/pixel<br />
Mode 45 : 1024x768, 16 bits/pixel<br />
Mode 49 : 1280x1024, 16 bits/pixel<br />
Mode 4b : 1600x1200, 16 bits/pixel<br />
Mode 4d : 1280x768, 16 bits/pixel<br />
Mode 50 : 640x480, 32 bits/pixel<br />
Mode 52 : 800x600, 32 bits/pixel<br />
Mode 54 : 1024x768, 32 bits/pixel<br />
Mode 58 : 1280x1024, 32 bits/pixel<br />
Mode 5a : 1600x1200, 32 bits/pixel<br />
Mode 5c : 1280x768, 32 bits/pixel<br />
<br />
Before everything's set, you will also need to add the proper modelines in xorg.conf. This is done in the monitor section<br />
Section "Monitor"<br />
Identifier "InternalMonitor"<br />
Option "DPMS"<br />
HorizSync 28.0 - 96.0<br />
VertRefresh 50.0 - 75.0<br />
Modeline "1280x768" 80.14 1280 1344 1480 1680 768 769 772 795<br />
Modeline "1024x768" 65.00 1024 1047 1183 1343 768 770 776 805<br />
EndSection<br />
<br />
==Audio==<br />
{{sn|relevant modules:<br />
* snd-intel8x0}}<br />
The audio is really not a big deal, at least not if you use alsa (which is the only sound system I've ever used under linux). The only weirdness is that the Master channel has no effect on the sound, you have to play around with the Headphone and PCM channels in order to set the sound.<br />
<br />
== Wireless Network ==<br />
{{sn|relevant modules:<br />
* ipw2200}}<br />
[[Wireless]] network is an Intel Pro Wireless 2200BG and has very good linux drivers nowadays. If you're using the stock arch kernel, all you need to do is<br />
pacman -S ipw2200<br />
and add the proper modules to your rc.conf (see the rc.conf section of this page) if you're not using hotplug or hwd.<br />
<br />
== Card Readers ==<br />
=== PCMCIA ===<br />
{{sn|relevant modules:<br />
* yenta_socket}}<br />
As far as I've understood from other reports, the pcmcia card works as expected. I don't have one at this time, so I can't confirm it.<br />
<br />
=== Compact Flash ===<br />
The same goes for the Compact Flash. It's supposed to work as it uses the same interfaces as the PCMCIA does, but I can't confirm anything since I don't have a CF-card.<br />
<br />
=== Secure Digital ===<br />
There is now a driver in alpha test stage on Sourceforge http://sourceforge.net/projects/sdricohcs/ it supports only the SD Card driver so far and must be compiled from source. Arch packages found here http://aur.archlinux.org/packages.php?do_Details=1&ID=9884.<br />
<br />
==Important Config files==<br />
===Kernel Config===<br />
Throughout most of linux days I've been using morph-sources, but recently I've been starting to use archck. Here's a config file for the kernel that can be used as a base. There are doubtless changes you should do, but it's always nice to have something to start off from. [I realise that I can't post the config file since it's so large... perhaps if it could be uploaded somehow and linked to :-/]<br />
<br />
===xorg.conf===<br />
[[Xorg]] 6.8.2 has loses direct rendering after resume from either suspend-to-disk or suspend-to-ram. I'm therefore using a snapshot of the upcoming xorg release, which has this issue solved. If you decide the to use the snapshot remember that you won't need to load the glcore module, so you can comment that in the xorg.conf.<br />
<br />
I've been playing around a lot to get the TV-out working, but alas! (I'm actually keeping a Win-partition in order to be able to use the TV-out - it feels like a complete waste of gigabytes of my precious harddrive!). The setup you see here is for an internal monitor. If you alter the ServerLayout section so that you have InternalScreen commented instead of ExternalScreen, X should work with an external screen. There was some issue with xorg 6.8.2 that prevented it from showing image on internal and external screens simultaneously, but that is allegedly solved now. I haven't updated my xorg.conf, however, to reflect those changes.<br />
<br />
<pre><br />
Section "ServerLayout"<br />
Identifier "Work in Progress"<br />
# Screen 0 "ExternalScreen" 0 0<br />
Screen 0 "InternalScreen" 0 0<br />
# Screen 1 "ExternalScreen" RightOf "InternalScreen"<br />
InputDevice "Keyboard" "CoreKeyboard"<br />
InputDevice "Synaptics TouchPad" "AlwaysCore"<br />
InputDevice "USB Mouse" "CorePointer"<br />
EndSection<br />
<br />
Section "ServerFlags"<br />
Option "AllowMouseOpenFail" "true"<br />
# Option "BlankTime" "7" # Blank the screen after 10 minutes (Fake)<br />
# Option "StandbyTime" "10" # Turn off screen after 15 minutes (DPMS)<br />
# Option "SuspendTime" "15" # Full suspend after 20 minutes<br />
Option "OffTime" "20" # Turn off after half an hour<br />
EndSection<br />
<br />
Section "Files"<br />
RgbPath "/usr/X11R6/lib/X11/rgb"<br />
ModulePath "/usr/X11R6/lib/modules"<br />
FontPath "/usr/X11R6/lib/X11/fonts/misc:unscaled"<br />
FontPath "/usr/X11R6/lib/X11/fonts/75dpi:unscaled"<br />
FontPath "/usr/X11R6/lib/X11/fonts/100dpi:unscaled"<br />
FontPath "/usr/X11R6/lib/X11/fonts/cyrillic"<br />
FontPath "/usr/X11R6/lib/X11/fonts/Type1"<br />
FontPath "/usr/local/share/fonts"<br />
EndSection<br />
<br />
Section "Module"<br />
Load "ddc" # ddc probing of monitor<br />
Load "GLcore"<br />
Load "dbe"<br />
Load "dri"<br />
Load "extmod"<br />
Load "glx"<br />
Load "bitmap" # bitmap-fonts<br />
Load "type1"<br />
Load "freetype"<br />
Load "record"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Keyboard"<br />
Driver "kbd"<br />
Option "CoreKeyboard"<br />
Option "XkbRules" "xfree86"<br />
Option "XkbModel" "pc105"<br />
Option "XkbLayout" "se"<br />
<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "USB Mouse"<br />
Driver "mouse"<br />
Option "Device" "/dev/input/mice"<br />
Option "SendCoreEvents" "true"<br />
Option "Protocol" "IMPS/2"<br />
Option "ZAxisMapping" "4 5"<br />
Option "Buttons" "5"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Synaptics TouchPad"<br />
Driver "synaptics"<br />
Option "Device" "/dev/psaux"<br />
Option "Protocol" "auto-dev"<br />
Option "LeftEdge" "1700"<br />
Option "RightEdge" "5300"<br />
Option "TopEdge" "1700"<br />
Option "BottomEdge" "4200"<br />
Option "FingerLow" "25"<br />
Option "FingerHigh" "30"<br />
Option "MaxTapTime" "180"<br />
Option "MaxTapMove" "220"<br />
Option "VertScrollDelta" "100"<br />
Option "MinSpeed" "0.06"<br />
Option "MaxSpeed" "0.12"<br />
Option "AccelFactor" "0.0010"<br />
Option "SHMConfig" "on"<br />
Option "Repeater" "/dev/ps2mouse"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "InternalMonitor"<br />
Option "DPMS"<br />
HorizSync 28.0 - 96.0<br />
VertRefresh 50.0 - 75.0<br />
Modeline "1280x768" 80.14 1280 1344 1480 1680 768 769 772 795<br />
Modeline "1024x768" 65.00 1024 1047 1183 1343 768 770 776 805<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "ExternalMonitor"<br />
Option "DPMS" "true"<br />
HorizSync 30.0-83.0<br />
VertRefresh 56.0-76.0<br />
Modeline "1280x1024" 138.54 1280 1368 1504 1728 1024 1025 1028 1069<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Television"<br />
HorizSync 30-68<br />
VertRefresh 50-120<br />
# fbset -fb /dev/fb1 -x<br />
Mode "720x576"<br />
# D: 42.600 MHz, H: 45.127 kHz, V: 74.963 Hz<br />
DotClock 42.601<br />
HTimings 720 760 832 944<br />
VTimings 576 577 580 602<br />
Flags "-HSync" "-VSync"<br />
EndMode<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "Intel"<br />
Driver "i810"<br />
# BusID "PCI:0:2:0"<br />
# Option "MonitorLayout" "TV,LFP"<br />
# BusID "PCI:1:0:0"<br />
# VideoRam 65536<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "InternalScreen"<br />
Device "Intel"<br />
Monitor "InternalMonitor"<br />
DefaultColorDepth 24<br />
SubSection "Display"<br />
Depth 16<br />
Modes "1280x768" "1024x768" "800x600" "640x480"<br />
EndSubSection<br />
SubSection "Display"<br />
Depth 24<br />
Modes "1280x768" "1024x768" "800x600" "640x480"<br />
ViewPort 0 0<br />
EndSubSection<br />
SubSection "Display"<br />
Depth 32<br />
Modes "1280x768" "1024x768" "800x600" "640x480"<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "ExternalScreen"<br />
Device "Intel"<br />
Monitor "ExternalMonitor"<br />
DefaultColorDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
Modes "1280x1024"<br />
ViewPort 0 0<br />
EndSubsection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "TVScreen"<br />
Device "Intel"<br />
Monitor "Television"<br />
DefaultDepth 24<br />
Subsection "Display"<br />
Depth 24<br />
Modes "768x576"<br />
ViewPort 0 0<br />
EndSubsection<br />
EndSection<br />
<br />
<br />
Section "DRI"<br />
Mode 0666<br />
EndSection<br />
<br />
Section "Extensions"<br />
Option "Composite" "Enable"<br />
Option "RENDER" "Enable"<br />
EndSection<br />
</pre><br />
<br />
===cpufreqd.conf===<br />
I've had quite a hard time deciding what the best cpufreqd setup would be for me. Right now I'm using this:<br />
<pre><br />
# this is a comment<br />
#<br />
# you need: 1 [General] section, <br />
# 1 or more [Profile] sections<br />
# 1 or more [Rule] sections<br />
#<br />
# a section ends at the first blank line<br />
#<br />
# [Rule] sample:<br />
# [Rule]<br />
# name=sample_rule<br />
# ac=on # (on/off)<br />
# battery_interval=0-10<br />
# cpu_interval=30-60<br />
# programs=xine,mplayer<br />
# profile=sample_profile<br />
#<br />
# [Profile] sample:<br />
# [Profile]<br />
# name=sample_profile<br />
# minfreq=10%<br />
# maxfreq=100%<br />
# policy=performance<br />
#<br />
# see CPUFREQD.CONF(5) manpage for a complete reference<br />
<br />
[General]<br />
pidfile=/var/run/cpufreqd.pid<br />
poll_interval=2<br />
pm_type=acpi #(acpi, apm or pmu)<br />
# Uncomment the following line to enable ACPI workaround (see cpufreqd.conf(5))<br />
# acpi_workaround=1<br />
verbosity=5 #(if you want a minimal logging set to 5)<br />
<br />
[Profile]<br />
name=hi_boost<br />
minfreq=1000000<br />
maxfreq=1200000<br />
policy=performance<br />
<br />
[Profile]<br />
name=medium_boost<br />
minfreq=800000<br />
maxfreq=1000000<br />
policy=conservative<br />
<br />
[Profile]<br />
name=lo_boost<br />
minfreq=600000<br />
maxfreq=800000<br />
policy=performance<br />
<br />
[Profile]<br />
name=lo_power<br />
minfreq=0<br />
maxfreq=600000<br />
policy=powersave<br />
<br />
# conservative mode when not AC<br />
[Rule]<br />
name=low_bat_conservative<br />
ac=off<br />
battery_interval=0-100<br />
cpu_interval=0-35<br />
profile=lo_power<br />
<br />
#[Rule]<br />
name=conservative<br />
ac=off # (on/off)<br />
battery_interval=0-100 <br />
cpu_interval=35-60<br />
profile=lo_boost<br />
<br />
# need some power<br />
<br />
[Rule]<br />
name=lo_cpu_boost<br />
ac=off # (on/off)<br />
battery_interval=0-100<br />
cpu_interval=60-80<br />
profile=medium_boost<br />
<br />
# need big power (not if battery very low)<br />
[Rule]<br />
name=hi_cpu_boost<br />
ac=off # (on/off)<br />
battery_interval=50-100<br />
cpu_interval=80-100<br />
profile=hi_boost<br />
<br />
full power when AC<br />
[Rule]<br />
name=AC_on<br />
ac=on # (on/off)<br />
profile=hi_boost<br />
<br />
</pre><br />
<br />
===rc.conf (modules array)===<br />
This is just a starting point, you might want to load other modules or you might have some of these compiled into the kernel.<br />
<br />
<pre><br />
MODULES=(evdev \<br />
snd-intel8x0 snd-pcm-oss snd-mixer-oss snd-seq-oss \<br />
uhci-hcd ehci-hcd ohci1394 \<br />
ieee80211_crypt ieee80211 ipw2200 \<br />
i2c-i801 agp-intel i915)<br />
</pre><br />
<br />
==Other Tweaks==<br />
I have a repository with some tweaked packages. Most noticably, there's an archck8-kernel, compiled for the lifebook p7010, as well as other packages compiled for the pentium-m processor (which could be used for other laptops too), such as a few of the KDE 3.4.3 packages, e17, and a few other things. Information on how to use my repository can be found [http://www.naderehvandi.net/computers.html here]<br />
<br />
= External Links =<br />
* This report is listed at the [http://tuxmobil.org/fujitsu.html TuxMobil: Linux Laptop and Notebook Installation Guides Survey: Fujitsu-Siemens - FSC].</div>Pwdhttps://wiki.archlinux.org/index.php?title=Compaq_v3010us&diff=89411Compaq v3010us2009-12-30T16:47:38Z<p>Pwd: add out of date: referring to ancient versioned arch installs</p>
<hr />
<div>[[Category:HP (English)]] [[Category:HOWTOs (English)]]<br />
{{stub}}<br />
{{out of date}}<br />
Like many laptops, these model is cursed with the "Broadcom Corporation Dell Wireless 1390 WLAN Mini-PCI Card" wireless card.<br />
<br />
Good news, you can exchange it with another Mini-PCI card or we can try and get it to work as best as possible.<br />
<br />
==Install==<br />
I have worked with both Arch Stable (0.7.2) and Current (0.8.0 beta) in both i686 and x86_64 architectures.<br />
<br />
i686 +software +hw -wifi<br />
x86_64 +wifi -software -hw<br />
<br />
No real difference between Stable and Current for this laptop, so you may install as you would any other box or book.</div>Pwdhttps://wiki.archlinux.org/index.php?title=Averatec_3320-EH1&diff=89394Averatec 3320-EH12009-12-30T16:43:54Z<p>Pwd: add ln to xorg</p>
<hr />
<div>[[Category:Averatec (English)]] [[Category:HOWTOs (English)]]<br />
This is a short walkthough of what I did on my Averatec 3320-EH1. <br />
<br />
{{note|A similar machine, Averatec 33'''6'''0-EH1, is a Centrino laptop. This means that it has a Pentium M processor and uses Intel wireless (probably ipw2200) so some things are different. However, many configurations might be the same.}}<br />
<br />
==Short review==<br />
For about $1000 it's a good deal. A good 80GM with 512 RAM is pretty good. The sound card is okay, not much static and the speakers, while quiet (and placed underneath your typing hands--doens't help), serve the purpose. ACPI detects the CPU temperature and the fan works okay, but the laptop can get really hot on the bottom. The screen is horrid. If you worry about other people reading from your screen, you're safe. Actually, it is often the case that you yourself won't be able to see the whole screen clearly because the edges of the screen won't be at a 90 degree angle with respect to your eyes. Wireless is shot -- more on that later. The CD can get loud, but was never a big problem. Sticky pads kept falling off from the bottom and the case is plastic and not very sturdy. However, the computer is mobile enough and not heavy. The touchpad and keyboard feel natural.<br />
<br />
==Specifications==<br />
Averatec 3320-EH1<br />
* Intel® Celeron® M 360<br />
* 12.1" XGA (1024x768)<br />
* Dual DVD +/- Burner<br />
* 80GB, 5400rpm HD<br />
* 512MB DDR<br />
* Wireless RaLink RT2500 802.11g<br />
* 3 USB 2.0 ports<br />
* Dimensions(WxDxH): 10.9" x 9.6" x 1"<br />
* Weight: 4.6 lbs<br />
* Battery life: from 3h to 3.5h<br />
<br />
<pre><br />
# lspci<br />
00:00.0 Host bridge: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02) <br />
00:00.1 System peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)<br />
00:00.3 System peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)<br />
00:02.0 VGA compatible controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02)<br />
00:02.1 Display controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02)<br />
00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 03)<br />
00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 03)<br />
00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 03)<br />
00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 03)<br />
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 83)<br />
00:1f.0 ISA bridge: Intel Corporation 82801DBM (ICH4-M) LPC Interface Bridge (rev 03)<br />
00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE Controller (rev 03)<br />
00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 03)<br />
00:1f.6 Modem: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 03)<br />
01:04.0 Network controller: RaLink Ralink RT2500 802.11 Cardbus Reference Card (rev 01)<br />
01:05.0 CardBus bridge: O2 Micro, Inc. OZ711M1/MC1 4-in-1 MemoryCardBus Controller (rev 20)<br />
01:05.1 CardBus bridge: O2 Micro, Inc. OZ711M1/MC1 4-in-1 MemoryCardBus Controller (rev 20)<br />
01:05.2 System peripheral: O2 Micro, Inc. OZ711Mx 4-in-1 MemoryCardBus Accelerator<br />
01:06.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)<br />
</pre><br />
<br />
<pre><br />
# lshwd<br />
00:00.0 Host bridge: Intel Corp.|852GM Host-Hub Interface Bridge (intel-agp)<br />
00:00.1 System peripheral: Intel Corp.|852GM System Memory Controller (unknown)<br />
00:00.3 System peripheral: Intel Corp.|852GM Configuration Process (unknown)<br />
00:02.0 VGA compatible controller: Intel Corp.|852GM/852GME/855GM/855GME Chipset Graphics Controller (vesa)<br />
00:02.1 Display controller: Intel Corp.|852GM/852GME/855GM/855GME Chipset Graphics Controller (vesa)<br />
00:1d.0 USB Controller: Intel Corp.|82801DB USB Controller (uhci_hcd)<br />
00:1d.1 USB Controller: Intel Corp.|82801DB USB Controller (uhci_hcd)<br />
00:1d.2 USB Controller: Intel Corp.|82801DB USB Controller (uhci_hcd)<br />
00:1d.7 USB Controller: Intel Corp.|82801DB USB Enhanced Controller (ehci-hcd)<br />
00:1e.0 PCI bridge: Intel Corp.|82801 Hub Interface to PCI Bridge (hw_random)<br />
00:1f.0 ISA bridge: Intel Corp.|82801DBM LPC Interface Bridge (unknown)<br />
00:1f.1 IDE interface: Intel Corp.|82801DBM IDE Controller (UltraATA/100) (piix)<br />
00:1f.5 Multimedia audio controller: Intel Corp.|ICH4 845G/GL Chipset AC'97 Audio Controller (snd-intel8x0)<br />
00:1f.6 Modem: Intel Corp.|82801DB AC (slamr)<br />
01:04.0 Network controller: RaLink|Ralink RT2500 802.11 Cardbus Reference Card (rt2500)<br />
01:05.0 CardBus bridge: O2Micro Inc|OZ711M1 SmartCardBus MultiMediaBay Controller (yenta_socket)<br />
01:05.1 CardBus bridge: O2Micro Inc|OZ711M1 SmartCardBus MultiMediaBay Controller (yenta_socket)<br />
01:05.2 System peripheral: O2 Micro, Inc.|OZ711Mx MultiMediaBay Accelerator (yenta_socket)<br />
01:06.0 Ethernet controller: Realtek|RTL-8139 (8139too)<br />
003:001 USB Hub: Virtual|Hub (hub)<br />
002:001 USB Hub: Virtual|Hub (hub)<br />
004:002 USB Human Interface Devices: Logitech Inc.|Optical Mouse [/dev/input/mice] (usbhid)<br />
004:001 USB Hub: Virtual|Hub (hub)<br />
001:001 USB Hub: Virtual|Hub (hub)<br />
---:--- Mouse: PS/2 Mouse port [/dev/psaux] (msintellips/2)<br />
</pre><br />
<br />
I used to play around with the modules, but then did mkinitrd auto and (almost) everything started working like a charm. My [[xorg]].conf and fstab are pasted below<br />
<br />
==Network==<br />
{{sn|relevant modules:<br />
* 8139too}}<br />
Out of the box. Look at Wireless section for wireless.<br />
<br />
===Wireless===<br />
{{sn|relevant modules:<br />
* rt2500}}<br />
<br />
'''Note:''' As of kernel 2.6.17 there is no more support for the rt2500 module. This means that you have just joined me in being screwed. You can still try ndiswrapper or rt2x00.<br />
'''Note:''' If you are using kernel 2.6.16, there is still hope for you with the instructions below. You can also try the rt2500 module from the unstable repository which I have noticed in the meantime.<br />
<br />
RaLink RT2500 is a tough little card. The drivers derived from the original do not work with SMP kernels, they freeze your whole system upon ifconfig ra0 up (the card shows up as ra0). I had to recompile my kernel. First install [[ABS]]. Then go to /var/abs/local/kernel26/ or whatever. Edit config from:<br />
<pre><br />
CONFIG_SMP=y<br />
</pre><br />
to<br />
<pre><br />
# CONGIG SMP is not set<br />
</pre><br />
You will need to md5sum config and update the PKGBUILD. Then makepkg PKGBUILD and it will buzz off into the sunset producing a kernel that works with the rt2500 module. <br />
Use the [http://prdownloads.sourceforge.net/rt2400/rt2500-1.1.0-b3.tar.gz beta3] version of the rt2500 driver. Others didn't even compile with me.<br />
Remember: backup you current kernel (just copy the file and mkinitrd image to another name in boot and edit your bootloader) in case something BAD happens.<br />
<br />
If you don't want to recompile your kernel every time you update you (maybe) have two options:<br />
* [[Ndiswrapper_and_wpa_supplicant]] - iwconfig, iwlist didn't work for me;<br />
* [[Rt2x00]] - dhcpcd didn't work for me.<br />
<br />
I never made use of the wireless button.<br />
<br />
==Video==<br />
{{sn|relevant modules:<br />
* i810}}<br />
I remember having some trouble with the video drivers during some kernel (2.6.13 abouts) but that didn't last. Just pacman -S xf86-video-i810 and you should be fine. Use the vesa module if you have problems.<br />
<br />
==Audio==<br />
{{sn|relevant modules:<br />
* snd-intel8x0}}<br />
Follow this wiki's [[ALSA]] setup.<br />
<br />
==Power management==<br />
Worked out of the box ''after'' I did mkinitrd auto. I have throttling support, temperature measurements, good button support but no fan control. Never played with the scripting too much. Look at other laptops on the wiki.<br />
<br />
==Card readers==<br />
===PCMCIA===<br />
{{sn|relevant modules:<br />
* yenta_socket<br />
* ???}}<br />
Never used it.<br />
<br />
===Flash card reader===<br />
{{sn|relevant modules:<br />
* ???}}<br />
Never used it. On a brighter note, with autofs all my flash devices worked on plug in.<br />
<br />
==Configuration files==<br />
===/etc/X11/xorg.conf===<br />
In case you can't start X, look closely at the error messages; if they mention fonts either change your xorg.conf or install a bunch of font packages as I have (since I carried this xorg.conf through a few different installs).<br />
<pre><br />
Section "Module"<br />
<br />
Load "synaptics" <br />
Load "dbe" # Double buffer extension<br />
<br />
SubSection "extmod"<br />
Option "omit xfree86-dga" # don't initialise the DGA extension<br />
EndSubSection<br />
<br />
Load "type1"<br />
# Load "speedo"<br />
# Load "freetype"<br />
Load "xtt"<br />
<br />
Load "glx"<br />
Load "dri"<br />
Load "GLcore"<br />
<br />
EndSection<br />
<br />
Section "Files"<br />
<br />
RgbPath "/usr/share/X11/rgb"<br />
<br />
FontPath "/usr/share/fonts/100dpi/"<br />
FontPath "/usr/share/fonts/75dpi/"<br />
FontPath "/usr/share/fonts/TTF/"<br />
FontPath "/usr/share/fonts/Type1/"<br />
# FontPath "/usr/share/fonts/CID/"<br />
# FontPath "/usr/share/fonts/local/"<br />
# FontPath "/usr/share/fonts/Speedo/"<br />
# FontPath "/usr/share/fonts/TrueType/"<br />
# FontPath "/usr/share/fonts/freefont/"<br />
FontPath "/usr/share/fonts/cyrillic"<br />
FontPath "/usr/share/fonts/encodings/"<br />
FontPath "/usr/share/fonts/util/"<br />
FontPath "/usr/share/fonts/misc/"<br />
FontPath "/home/perun/.fonts/"<br />
<br />
ModulePath "/usr/lib/xorg/modules"<br />
<br />
EndSection<br />
<br />
Section "InputDevice"<br />
<br />
Identifier "Averatec Keyboard"<br />
Driver "kbd"<br />
<br />
Option "AutoRepeat" "500 30"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "pc101"<br />
Option "XkbLayout" "us,si"<br />
Option "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll"<br />
<br />
EndSection<br />
<br />
Section "InputDevice"<br />
<br />
Identifier "USB Mouse"<br />
Driver "mouse"<br />
Option "Protocol" "IMPS/2"<br />
Option "Device" "/dev/input/mice"<br />
Option "ZAxisMapping" "4 5"<br />
<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Synaptics Touchpad"<br />
Driver "synaptics"<br />
Option "SendCoreEvents" "true"<br />
# Option "Device" "/dev/psaux"<br />
Option "Device" "/dev/input/mice"<br />
Option "Protocol" "auto-dev"<br />
# Option "HorizScrollDelta" "0"<br />
Option "SHMConfig" "on"<br />
Option "Emulate3Buttons"<br />
<br />
EndSection<br />
<br />
Section "Monitor"<br />
<br />
Identifier "Laptop Screen"<br />
Option "DPMS" "true"<br />
<br />
HorizSync 31.5-48.5<br />
VertRefresh 30-75<br />
<br />
EndSection<br />
<br />
<br />
Section "Device"<br />
Identifier "Standard VGA"<br />
VendorName "Unknown"<br />
BoardName "Unknown"<br />
<br />
Driver "vga"<br />
<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Intel Corporation 82852/855GM Integrated Graphics Device"<br />
# Vesa is the generic driver if i810 doesn't work<br />
# Driver "vesa"<br />
Driver "i810"<br />
BusID "PCI:0:2:0"<br />
VideoRam 65536<br />
<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Averatec Screen"<br />
Device "Intel Corporation 82852/855GM Integrated Graphics Device"<br />
Monitor "Laptop Screen"<br />
DefaultDepth 16<br />
# DefaultDepth 24<br />
<br />
Subsection "Display"<br />
Depth 8<br />
Modes "1024x768" "800x600" "640x480"<br />
ViewPort 0 0<br />
EndSubsection<br />
Subsection "Display"<br />
Depth 16<br />
Modes "1024x768" "800x600" "640x480"<br />
ViewPort 0 0<br />
EndSubsection<br />
Subsection "Display"<br />
Depth 24<br />
Modes "1024x768" "800x600" "640x480"<br />
ViewPort 0 0<br />
EndSubsection<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
<br />
Screen "Averatec Screen"<br />
<br />
InputDevice "USB Mouse" "CorePointer"<br />
InputDevice "Synaptics Touchpad" "CorePointer"<br />
InputDevice "Averatec Keyboard" "CoreKeyboard"<br />
<br />
# DPMS Options<br />
<br />
Option "StandbyTime" "5"<br />
Option "SuspendTime" "6"<br />
Option "OffTime" "7" <br />
<br />
EndSection<br />
<br />
Section "DRI"<br />
Mode 0666<br />
EndSection<br />
</pre><br />
<br />
===/etc/fstab===<br />
It's probably a bad idea to write to a ntfs filesystem.<br />
<pre><br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
<br />
/dev/cdrom /mnt/cd iso9660 ro,user,noauto,unhide 0 0<br />
/dev/dvd /mnt/dvd auto ro,user,noauto,unhide 0 0<br />
<br />
/dev/hda5 swap swap defaults 0 0<br />
/dev/hda2 / reiserfs defaults 0 0<br />
/dev/hda6 /home reiserfs defaults 0 0<br />
/dev/hda1 /mnt/win ntfs user,auto,rw,umask=0 0 0<br />
<br />
</pre><br />
<br />
==External links==<br />
* This document is listed at the [http://tuxmobil.org/averatec.html TuxMobil Linux laptop and notebook installation guides survey (Averatec)].</div>Pwdhttps://wiki.archlinux.org/index.php?title=User_talk:Totalwormage&diff=89336User talk:Totalwormage2009-12-30T16:28:00Z<p>Pwd: /* Wrong categories */ forgot sign</p>
<hr />
<div>==Wrong categories==<br />
Those categories shouldn't be member of the HOWTOs cat. File system, for example, should be member of Software, as per the [[Table of Contents (English)]] page. Why are you including them into HOWTO? <small>[[User:Pwd|pwd]]</small> 11:22, 30 December 2009 (EST)<br />
<br />
i'm blindly moving pages that belonged to 'HowTos' to 'HOWTOs', assuming they belong there. (should i reply here?) [[User:Totalwormage|totalwormage]] 11:24, 30 December 2009 (EST)<br />
<br />
:Some pages do belong in HOWTO, but ''categories'' do not. See the table of contents I linked to; this has the category structure laid out already. <small>[[User:Pwd|pwd]]</small> 11:28, 30 December 2009 (EST)</div>Pwdhttps://wiki.archlinux.org/index.php?title=User_talk:Totalwormage&diff=89334User talk:Totalwormage2009-12-30T16:27:22Z<p>Pwd: /* Wrong categories */ some pages should go in hotos, categories do not</p>
<hr />
<div>==Wrong categories==<br />
Those categories shouldn't be member of the HOWTOs cat. File system, for example, should be member of Software, as per the [[Table of Contents (English)]] page. Why are you including them into HOWTO? <small>[[User:Pwd|pwd]]</small> 11:22, 30 December 2009 (EST)<br />
<br />
i'm blindly moving pages that belonged to 'HowTos' to 'HOWTOs', assuming they belong there. (should i reply here?) [[User:Totalwormage|totalwormage]] 11:24, 30 December 2009 (EST)<br />
<br />
:Some pages do belong in HOWTO, but ''categories'' do not. See the table of contents I linked to; this has the category structure laid out already.</div>Pwd