linux SAMBA HOWTO

来源:互联网 发布:如何禁止软件联网 编辑:程序博客网 时间:2024/06/10 13:54

linux SAMBA HOWTO

1. Version
   linux kernel: 2.6.9
   SAMBA version: 3.0.8pre1-0.pre1.3
  
2. Compile & Install
   1> unpack 3.0.8pre1-0.pre1.3 source code
    $tar zxvf 3.0.8pre1-0.pre1.3.tar.gz
   2> configure
    $cd source
    $./configure --with-smbmount --prefix=/usr/local/samba
   3> make
    $make
   4> install
    $make install

3. Configuration
   1> copy /examples/smb.conf.default as smb.conf
    programme testparm can be used to test this configuration file
   2> change smb.conf
    [global]
    workgroup = MyGroup
    server string = Samba Server
    printcap name = /etc/printcap
    load printers = yes
   cups options = raw
   log file = /var/log/samba/%m.log
   max log size =50
   security = user
   encrypt passwords = yes
   smb passwd file = /etc/samba/smbpasswd
  username map = /etc/samba/smbusers
  socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
  dns proxy = no

 [Test_share]
  comment = This share for Test development
  path = /export/mnt/
 ; valid users = tao
  only guest = yes
  public = yes
  writeable = yes
  printable = no
  browseable = yes

4. Start service
   /usr/local/samba/sbin/smbd -D
   /usr/local/samba/sbin/nmbd -D
  
   If hope the SAMBA server auto starts while linux system booting up, add this code to /etc/rc.d/rc.local
   like this:
   [root@linux lib]# vi /etc/rc.d/rc.local
 #!/bin/sh
 #
 # This script will be executed *after* all the other init scripts.
 # You can put your own initialization stuff in here if you don't
 # want to do the full Sys V style init stuff.

 touch /var/lock/subsys/local
 /usr/local/samba/sbin/smbd -D &
 /usr/local/samba/sbin/nmbd -D &

5. Set user account
 $smbpasswd -a user_account
 $New SMB password: new passwd
 $Retype new SMB password: passwd again
 
6. Visit share linux directory from windows system
 type //ip_address_of_linux_shared
 type user account, password 

原创粉丝点击