smbd
and nmbd
.
dpkg-reconfigure samba-common samba
.
FALCOTNET
in our case). Another question asks whether passwords should be encrypted. The answer is that they should, because it's a requirement for the most recent Windows clients; besides, this increases security. The counterpart is that this required managing Samba passwords separately from the Unix passwords.
inetd
or as stand-alone daemons. Using inetd
is only interesting when Samba is rarely used; the Falcot administrators therefore picked stand-alone daemons.
/etc/samba/smb.conf
configuration file. The following excerpts summarize the changes that were effected in the [global]
section.
[global] ## Browsing/Identification ### # Change this to the workgroup/NT-domain name your Samba server will part of workgroup = FALCOTNET # server string is the equivalent of the NT Description field server string = %h server (Samba %v) # Windows Internet Name Serving Support Section: # WINS Support - Tells the NMBD component of Samba to enable its WINS Server wins support = yes[...] ####### Authentication ####### # "security = user" is always a good idea. This will require a Unix account # in this server for every user accessing the server. See # /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html # in the samba-doc package for details. security = user
# You may wish to use password encryption. See the section on # 'encrypt passwords' in the smb.conf(5) manpage before enabling. encrypt passwords = true # If you are using encrypted passwords, Samba will need to know what # password database type you are using. passdb backend = tdbsam [...] ########## Printing ########## # If you want to automatically load your printer list rather # than setting them up individually then you'll need this load printers = yes
# lpr(ng) printing. You may wish to override the location of the # printcap file ; printing = bsd ; printcap name = /etc/printcap # CUPS printing. See also the cupsaddsmb(8) manpage in the # cups-client package. printing = cups
printcap name = cups
Indicates that Samba should act as a Netbios name server (WINS) for the local network.
| |
This is the default value for this parameter; however, since it is central to the Samba configuration, filling it explicitly is recommended. Each user must authenticate before accessing any share.
| |
Tells Samba to automatically share all local printers that exist in the CUPS configuration. Restricting access to these printers is still possible, by adding appropriate sections.
| |
Specifies the printing system in use; in our case, CUPS.
|
adduser
for instance).
smbpasswd -a user
command; this command asks for the password interactively.
smbpasswd -x user
command. A Samba account can also be temporarily disabled (with smbpasswd -d user
) and re-enabled later (with smbpasswd -e user
).
[global]
section of the configuration file:
domain logons = yespreferred master = yes logon path = \\%L\profiles\%U
logon script = scripts/logon.bat
[netlogon] comment = Network Logon Service path = /var/lib/samba/netlogon guest ok = yes writable = no share modes = no [profiles] comment = Profile Share path = /var/lib/samba/profiles read only = No profile acls = Yes
/var/lib/samba/profiles/user
), and each of them must be owned by the matching user.
smbclient
program queries SMB servers. It accepts a -U user
option, for connecting to the server under a specific identity. smbclient //server
/share
accesses the share in an interactive way similar to the command-line FTP client. smbclient -L server
lists all available (and visible) shares on a server.
mount
command allows mounting a Windows share into the Linux filesystem hierarchy (with the help of mount.cifs
provided by cifs-utils).
Example 11.28. Mounting a Windows share
mount -t cifs //arrakis/shared /shared \ -o credentials=/etc/smb-credentials
/etc/smb-credentials
file (which must not be readable by users) has the following format:
username =user
password =password
uid
and gid
allow forcing the owner and group of files available on the mount, so as not to restrict access to root.
/etc/fstab
:
//server
/shared /shared cifs credentials=/etc/smb-credentials
umount
command.
http://localhost:631/admin
smb://user
:password
@server
/printer
.