Difference between revisions of "Samba"

From CBLFS
Jump to navigationJump to search
(Configuration Information)
Line 29: Line 29:
 
To build Samba against [[Linux-PAM]] pass one of the following to configure:
 
To build Samba against [[Linux-PAM]] pass one of the following to configure:
  
  --with-pam --with-pam-modulesdir=/lib/security
+
  --with-pam --with-pammodulesdir=/lib/security
  --with-pam --with-pam-modulesdir=/lib32/security
+
  --with-pam --with-pammodulesdir=/lib32/security
  --with-pam --with-pam-modulesdir=/lib64/security
+
  --with-pam --with-pammodulesdir=/lib64/security
  
 
To build Samba against [[Python]] pass the following to configure:
 
To build Samba against [[Python]] pass the following to configure:
Line 49: Line 49:
 
Install the package
 
Install the package
  
  make install &&
+
  make install-everything &&
 
  mv -v /usr/lib/samba/libsmbclient.so /usr/lib &&
 
  mv -v /usr/lib/samba/libsmbclient.so /usr/lib &&
 
  ln -v -sf ../libsmbclient.so /usr/lib/samba &&
 
  ln -v -sf ../libsmbclient.so /usr/lib/samba &&
Line 59: Line 59:
 
  ln -v -sf libnss_winbind.so /lib/libnss_winbind.so.2 &&
 
  ln -v -sf libnss_winbind.so /lib/libnss_winbind.so.2 &&
 
  ln -v -sf libnss_wins.so /lib/libnss_wins.so.2 &&
 
  ln -v -sf libnss_wins.so /lib/libnss_wins.so.2 &&
 
if [ -f nsswitch/pam_winbind.so ]; then
 
    install -v -m755 nsswitch/pam_winbind.so /lib/security
 
fi &&
 
 
   
 
   
 
  install -v -m644 ../examples/smb.conf.default /etc/samba &&
 
  install -v -m644 ../examples/smb.conf.default /etc/samba &&
Line 89: Line 85:
 
Install the package
 
Install the package
  
  make install &&
+
  make install-everything &&
 
  mv -v /usr/lib/samba/libsmbclient.so /usr/lib &&
 
  mv -v /usr/lib/samba/libsmbclient.so /usr/lib &&
 
  ln -v -sf ../libsmbclient.so /usr/lib/samba &&
 
  ln -v -sf ../libsmbclient.so /usr/lib/samba &&
Line 98: Line 94:
 
  install -v -m755 nsswitch/libnss_win{s,bind}.so /lib &&
 
  install -v -m755 nsswitch/libnss_win{s,bind}.so /lib &&
 
  ln -v -sf libnss_winbind.so /lib/libnss_winbind.so.2 &&
 
  ln -v -sf libnss_winbind.so /lib/libnss_winbind.so.2 &&
  ln -v -sf libnss_wins.so /lib/libnss_wins.so.2 &&
+
  ln -v -sf libnss_wins.so /lib/libnss_wins.so.2
 
if [ -f nsswitch/pam_winbind.so ]; then
 
    install -v -m755 nsswitch/pam_winbind.so /lib/security
 
fi
 
  
 
If you passed ''--with-python'' to the configure script issue the following command to install the [[Python]] extensions:
 
If you passed ''--with-python'' to the configure script issue the following command to install the [[Python]] extensions:
Line 126: Line 118:
 
Install the package
 
Install the package
  
  make install &&
+
  make install-everything &&
 
  mv -v /usr/lib32/samba/libsmbclient.so /usr/lib32 &&
 
  mv -v /usr/lib32/samba/libsmbclient.so /usr/lib32 &&
 
  ln -v -sf ../libsmbclient.so /usr/lib32/samba &&
 
  ln -v -sf ../libsmbclient.so /usr/lib32/samba &&
Line 135: Line 127:
 
  install -v -m755 nsswitch/libnss_win{s,bind}.so /lib32 &&
 
  install -v -m755 nsswitch/libnss_win{s,bind}.so /lib32 &&
 
  ln -v -sf libnss_winbind.so /lib32/libnss_winbind.so.2 &&
 
  ln -v -sf libnss_winbind.so /lib32/libnss_winbind.so.2 &&
  ln -v -sf libnss_wins.so /lib32/libnss_wins.so.2 &&
+
  ln -v -sf libnss_wins.so /lib32/libnss_wins.so.2
 
if [ -f nsswitch/pam_winbind.so ]; then
 
    install -v -m755 nsswitch/pam_winbind.so /lib32/security
 
fi
 
  
 
If you passed ''--with-python'' to the configure script issue the following command to install the [[Python]] extensions:
 
If you passed ''--with-python'' to the configure script issue the following command to install the [[Python]] extensions:
Line 150: Line 138:
  
 
=== 64Bit ===
 
=== 64Bit ===
 
  
 
Compile the package:
 
Compile the package:
Line 163: Line 150:
 
Install the package
 
Install the package
  
  make install &&
+
  make install-everything &&
 
  mv -v /usr/lib64/samba/libsmbclient.so /usr/lib64 &&
 
  mv -v /usr/lib64/samba/libsmbclient.so /usr/lib64 &&
 
  ln -v -sf ../libsmbclient.so /usr/lib64/samba &&
 
  ln -v -sf ../libsmbclient.so /usr/lib64/samba &&
Line 173: Line 160:
 
  ln -v -sf libnss_winbind.so /lib64/libnss_winbind.so.2 &&
 
  ln -v -sf libnss_winbind.so /lib64/libnss_winbind.so.2 &&
 
  ln -v -sf libnss_wins.so /lib64/libnss_wins.so.2 &&
 
  ln -v -sf libnss_wins.so /lib64/libnss_wins.so.2 &&
 
if [ -f nsswitch/pam_winbind.so ]; then
 
    install -v -m755 nsswitch/pam_winbind.so /lib64/security
 
fi &&
 
 
   
 
   
 
  install -v -m644 ../examples/smb.conf.default /etc/samba &&
 
  install -v -m644 ../examples/smb.conf.default /etc/samba &&

Revision as of 18:01, 8 October 2007

Download Source: ftp://us4.samba.org/pub/samba/stable/samba-3.5.6.tar.gz

Introduction to Samba

The Samba package provides file and print services to SMB/CIFS clients and Windows networking to Linux clients. Samba can also be configured as a Windows NT 4.0 Domain Controller replacement (with caveats working with NT PDC's and BDC's), a file/print server acting as a member of a Windows NT 4.0 or Active Directory domain and a NetBIOS (rfc1001/1002) nameserver (which amongst other things provides LAN browsing support).

Project Homepage: Unknown

Dependencies

Optional

Optional (For the passdb libraries)

Configuration Information

To build Samba against Linux-PAM pass one of the following to configure:

--with-pam --with-pammodulesdir=/lib/security
--with-pam --with-pammodulesdir=/lib32/security
--with-pam --with-pammodulesdir=/lib64/security

To build Samba against Python pass the following to configure:

--with-python

Non-Multilib

Compile the package:

cd source &&
./configure --prefix=/usr --sysconfdir=/etc \
    --localstatedir=/var --with-piddir=/var/run \
    --with-fhs --with-smbmount &&
make

Install the package

make install-everything &&
mv -v /usr/lib/samba/libsmbclient.so /usr/lib &&
ln -v -sf ../libsmbclient.so /usr/lib/samba &&
ln -v -sf libsmbclient.so /usr/lib/libsmbclient.so.0 &&

chmod -v 644 /usr/include/{libsmbclient,libmsrpc}.h &&

install -v -m755 nsswitch/libnss_win{s,bind}.so /lib &&
ln -v -sf libnss_winbind.so /lib/libnss_winbind.so.2 &&
ln -v -sf libnss_wins.so /lib/libnss_wins.so.2 &&

install -v -m644 ../examples/smb.conf.default /etc/samba &&

install -v -m755 -d /usr/share/doc/samba-3.5.6 &&
install -v -m644 ../docs/*.pdf /usr/share/doc/samba-3.5.6 &&
ln -v -s ../../samba/swat  /usr/share/doc/samba-3.5.6

If you passed --with-python to the configure script issue the following command to install the Python extensions:

make python_install

Multilib

32Bit

Compile the package:

export USE_ARCH=32 &&
cd source &&
CC="gcc ${BUILD32}" ./configure --prefix=/usr --sysconfdir=/etc \
    --localstatedir=/var --with-piddir=/var/run \
    --with-fhs --with-smbmount &&
make

Install the package

make install-everything &&
mv -v /usr/lib/samba/libsmbclient.so /usr/lib &&
ln -v -sf ../libsmbclient.so /usr/lib/samba &&
ln -v -sf libsmbclient.so /usr/lib/libsmbclient.so.0 &&

chmod -v 644 /usr/include/lib{smbclient,msrpc}.h &&

install -v -m755 nsswitch/libnss_win{s,bind}.so /lib &&
ln -v -sf libnss_winbind.so /lib/libnss_winbind.so.2 &&
ln -v -sf libnss_wins.so /lib/libnss_wins.so.2

If you passed --with-python to the configure script issue the following command to install the Python extensions:

make python_install

Clean up the enviornment:

unset USE_ARCH

N32

Compile the package:

export USE_ARCH=n32 &&
cd source &&
CC="gcc ${BUILDN32}" ./configure --prefix=/usr --sysconfdir=/etc \
    --with-libdir=/usr/lib32/samba --localstatedir=/var \
    --with-piddir=/var/run --with-fhs --with-smbmount &&
make

Install the package

make install-everything &&
mv -v /usr/lib32/samba/libsmbclient.so /usr/lib32 &&
ln -v -sf ../libsmbclient.so /usr/lib32/samba &&
ln -v -sf libsmbclient.so /usr/lib32/libsmbclient.so.0 &&

chmod -v 644 /usr/include/{libsmbclient,libmsrpc}.h &&

install -v -m755 nsswitch/libnss_win{s,bind}.so /lib32 &&
ln -v -sf libnss_winbind.so /lib32/libnss_winbind.so.2 &&
ln -v -sf libnss_wins.so /lib32/libnss_wins.so.2

If you passed --with-python to the configure script issue the following command to install the Python extensions:

make python_install

Clean up the enviornment:

unset USE_ARCH

64Bit

Compile the package:

export USE_ARCH=64 &&
cd source &&
CC="gcc ${BUILD64}" ./configure --prefix=/usr --sysconfdir=/etc \
    --with-libdir=/usr/lib64/samba --localstatedir=/var \
    --with-piddir=/var/run --with-fhs --with-smbmount &&
make

Install the package

make install-everything &&
mv -v /usr/lib64/samba/libsmbclient.so /usr/lib64 &&
ln -v -sf ../libsmbclient.so /usr/lib64/samba &&
ln -v -sf libsmbclient.so /usr/lib64/libsmbclient.so.0 &&

chmod -v 644 /usr/include/{libsmbclient,libmsrpc}.h &&

install -v -m755 nsswitch/libnss_win{s,bind}.so /lib64 &&
ln -v -sf libnss_winbind.so /lib64/libnss_winbind.so.2 &&
ln -v -sf libnss_wins.so /lib64/libnss_wins.so.2 &&

install -v -m644 ../examples/smb.conf.default /etc/samba &&

install -v -m755 -d /usr/share/doc/samba-3.5.6 &&
install -v -m644 ../docs/*.pdf /usr/share/doc/samba-3.5.6 &&
ln -v -s ../../samba/swat  /usr/share/doc/samba-3.5.6

If you passed --with-python to the configure script issue the following command to install the Python extensions:

make python_install

Clean up the enviornment:

unset USE_ARCH

Configuring

Mounting Shares by Unprivileged Users

For an unprivileged user to run smbmount and smbumount the comands must my setuid root:

chmod -v 4755 /usr/bin/smb{mnt,umount}

Bootscript

Install the init script for samba included in the blfs-bootscripts package:

make install-samba

Install the init script for winbind included in the blfs-bootscripts package:

make install-winbind

Creating /etc/samba/smb.conf

Client Only

Create a basic configuration file:

cat > /etc/samba/smb.conf << "EOF"
[global]
    workgroup = MYGROUP
    dos charset = cp850
    unix charset = ISO-8859-1
EOF

Client + Server Support

Create a share for each user's home directory, and share all printers to Windows machines:

cat > /etc/samba/smb.conf << "EOF"

[global]
    workgroup = MYGROUP
    dos charset = cp850
    unix charset = ISO-8859-1

[homes]
    comment = Home Directories
    browseable = no
    writable = yes

[printers]
    comment = All Printers
    path = /var/spool/samba
    browseable = no
    guest ok = no
    printable = yes
EOF

At this point, you will most likely want to install SWAT (Samba Web Administration Tool) to manage /etc/samba/smb.conf from a web browser.