linux下Samba服务配置与安装

一,RPM包安装samba服务器、
==================================================
[root@nyist3 root]# mount /mnt/cdrom
[root@nyist3 root]# cd /mnt/cdrom/RedHat/RPMS
[root@nyist3 RPMS]# rpm -ivh samba-c
samba-client-2.2.7a-7.9.0.i386.rpm  samba-common-2.2.7a-7.9.0.i386.rpm
[root@nyist3 RPMS]# rpm -ivh samba-common-2.2.7a-7.9.0.i386.rpm
warning: samba-common-2.2.7a-7.9.0.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing...                ########################################### [100%]
        package samba-common-2.2.7a-7.9.0 is already installed
[root@nyist3 RPMS]# rpm -ivh sa
samba-2.2.7a-7.9.0.i386.rpm         sane-backends-1.0.9-5.i386.rpm
samba-client-2.2.7a-7.9.0.i386.rpm  sane-frontends-1.0.9-2.i386.rpm
samba-common-2.2.7a-7.9.0.i386.rpm 
[root@nyist3 RPMS]# rpm -ivh samba-2.2.7a-7.9.0.i386.rpm
warning: samba-2.2.7a-7.9.0.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing...                ########################################### [100%]
   1:samba                  ########################################### [100%]
[root@nyist3 RPMS]# rpm -ivh samba-client-2.2.7a-7.9.0.i386.rpm
warning: samba-client-2.2.7a-7.9.0.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing...                ########################################### [100%]
        package samba-client-2.2.7a-7.9.0 is already installed
[root@nyist3 RPMS]# rpm -ivh redhat-config-samba-1.0.4-1.noarch.rpm
warning: redhat-config-samba-1.0.4-1.noarch.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing...                ########################################### [100%]
   1:redhat-config-samba    ########################################### [100%]
[root@nyist3 RPMS]# cd;eject
[root@nyist3 root]# mount /mnt/cdrom
[root@nyist3 root]# cd /mnt/cdrom/RedHat/RPMS
[root@nyist3 RPMS]# rpm -ivh sa
samba-swat-2.2.7a-7.9.0.i386.rpm  sawfish-1.2-5.i386.rpm
sash-3.4-16.i386.rpm             
[root@nyist3 RPMS]# rpm -ivh samba-swat-2.2.7a-7.9.0.i386.rpm
warning: samba-swat-2.2.7a-7.9.0.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing...                ########################################### [100%]
   1:samba-swat             ########################################### [100%]
=====================================================================
查看默认的配置文件/etc/samba/sa
[root@nyist3 RPMS]# grep -v "#" /etc/samba/smb.conf|grep -v ";"|sort -u

   browseable = no
   comment = All Printers
   comment = Home Directories
   create mode = 0664
   directory mode = 0775
   dns proxy = no
   encrypt passwords = yes
[global]
   guest ok = no
[homes]
   load printers = yes
   log file = /var/log/samba/%m.log
   max log size = 0
  obey pam restrictions = yes
   pam password change = yes
   passwd chat = *New*password* %n/n *Retype*new*password* %n/n *passwd:*all*authentication*tokens*updated*successfully*
   passwd program = /usr/bin/passwd %u
   path = /var/spool/samba
   printable = yes
   printcap name = /etc/printcap
[printers]
   printing = cups
   security = user
   server string = Samba Server
   smb passwd file = /etc/samba/smbpasswd
   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
   unix password sync = Yes
   valid users = %S
   workgroup = MYGROUP
   writable = no
   writable = yes
======================================================================
添加用户changlin
================
[root@nyist3 RPMS]# useradd changlin
[root@nyist3 RPMS]# smbpasswd -a changlin
New SMB password:
Retype new SMB password:
Password changed for user changlin.
================
查看samba服务器资源呗使用的情况
=============================
[root@nyist3 RPMS]# smbstatus

Samba version 2.2.7a
Service      uid      gid      pid     machine
----------------------------------------------
IPC$         changlin changlin  2592   c50039780a554ca (10.255.6.163) Sat Sep 20 22:32:32 2008
changlin     changlin changlin  2592   c50039780a554ca (10.255.6.163) Sat Sep 20 22:32:36 2008

No locked files

[root@nyist3 RPMS]# smbstatus -b

Samba version 2.2.7a
PID     Username  Machine                       Time logged in
-------------------------------------------------------------------
2592    changlin  c50039780a554ca               Sat Sep 20 22:32:32 2008
==================================================
启动服务器
[root@nyist3 RPMS]# service smb start
启动 SMB 服务:                                            [  确定  ]
启动 NMB 服务:
==============================

你可能感兴趣的:(linux下Samba服务配置与安装)