[root@redhat6 samba]# yum search samba Loaded plugins: product-id, refresh-packagekit, security, subscription-manager Updating certificate-based repositories. Repository rhel-source is listed more than once in the configuration ======================================================== N/S Matched: samba ======================================================== samba-client.i686 : Samba client programs samba-common.i686 : Files used by both Samba servers and clients samba-winbind.i686 : Samba winbind samba-winbind-clients.i686 : Samba winbind clients sblim-cmpi-samba.i686 : SBLIM WBEM-SMT Samba ctdb.i686 : A Clustered Database based on Samba's Trivial Database (TDB) samba.i686 : Server and Client software to interoperate with Windows machines Name and summary matches only, use "search all" for everything.
[root@redhat6 samba]# yum install samba.i686 Loaded plugins: product-id, refresh-packagekit, security, subscription-manager Updating certificate-based repositories. Repository rhel-source is listed more than once in the configuration Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package samba.i686 0:3.5.10-114.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ==================================================================================================================================== Package Arch Version Repository Size ==================================================================================================================================== Installing: samba i686 3.5.10-114.el6 rhel-source 5.0 M Transaction Summary ==================================================================================================================================== Install 1 Package(s) Total download size: 5.0 M Installed size: 17 M Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Warning: RPMDB altered outside of yum. Installing : samba-3.5.10-114.el6.i686 1/1 Installed products updated'. Installed: samba.i686 0:3.5.10-114.el6 Complete!
[global] security = user passdb backend = tdbsam #============================ Share Definitions ============================== [francs_share] comment = My share path = /francs_share public = yes writeable = yes browseable = yes
备注:修改参数 security = user 参数。
3.2 增加用户 user2
1 2 3 4 5 6
[root@redhat6 ~]# useradd user2 [root@redhat6 ~]# passwd user2 Changing password for user user2. New password: Retype new password: passwd: all authentication tokens updated successfully.
3.3 设置 samba 用户 user2 密码
1 2 3 4 5
[root@redhat6 ~]# smbpasswd -a user2 New SMB password: Retype new SMB password: Added user user2. [root@redhat6 ~]#
备注:这个密码是在 windows 平台上访问 Linux 共享目录的密码。
3.4 查看共享目录信息
1 2 3 4 5 6 7 8 9 10 11 12 13
[root@redhat6 ~]# smbclient -U user2 -L localhost Enter user2's password: Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.5.10-114.el6] Sharename Type Comment -------------------- francs_share Disk My share IPC$ IPC IPC Service (Samba Server Version 3.5.10-114.el6) user2 Disk Home Directories Domain=[MYGROUP] OS=[Unix] Server=[Samba 3.5.10-114.el6] Server Comment ---------------- Workgroup Master ----------------
3.5 重启 smb 服务
1 2 3
[root@redhat6 samba]# service smb restart Shutting down SMB services: [ OK ] Starting SMB services: [ OK ]