SAMBA的作用:
1.共享文件与打印机服务
2.可以提供用户登录SAMBA主机时的身份认证,以提供不同身份用户的个别数据
3.可以进行Windows网络上的主机名解析(NetBIOS Name)
4.可以进行设备的共享(例如Zip、CD-DOM)
SAMBA这个文件系统是架构在NetBIOS这个通信协议上面所开发出来的。NETBIOS是无法跨路由的。通过 NetBIOS ove TCP/IP的技术,我们就可以跨路由使用SAMBA服务器所提供的功能。
NetBEUI:NetBIOS Extened User Interface,IBM对NetBIOS发展出来之后的改良版本。
Windows工作步骤:
1.每个主机必须要有不同的Net BIOS Name才行,且要位于同一个工作组
2.利用对方给予的权限访问可用资源
SAMBA工作步骤:
1.nmbd:管理工作组、NetBIOS Name等的解析。主要利用UPD协议开启Port137、138来负责名称解析的任务
2.smbd:管理SAMBA主机共享的目录、文件与打印等。TCP Port 139,445(不一定存在)权限管理
连接模式
1.Peer/Peer(Workgroup model,对等模式)---适合小型的网络
2.Domain model(主控模式)---所有的账号与密码都放置在一台主控计算机上面(PDC)primary domain Controller
SAMBA所需要的软件:
1.samba:包括服务程序smbd,nmdb,logrotate配置文件;
2.samba-client:mount.cifs,取得类似网上邻居相关树形图的smbtree
3.samba-common:数据,smb.conf,语法检验命令(testparm)
相关配置文件:
1./etc/samba/smb.conf
2./etc/samba/lmhosts #NetBIOS Name 对应IP
3./etc/sysconfig/samba #相关服务参数
4./etc/samba/smbusers #处理Administrator root这两者的关系
5./var/lib/samba/private/{passdb.tdb,secrets.tdb} #SAMBA帐号密码
6./usr/share/doc/samba-*
用到的脚本程序:
1./usr/sbin/{smbd,nmbd}
2./usr/{tdbdump,tdbtool}:SAMBA使用的数据库名称为TDB(Trival DataBase)
tdbdump:查看数据库内容
tdbtool:修改账户数据 #要安装软件tdb-tools
3./usr/bin/smbstatus:
4./usr/bin/{smbpasswd,pdbedit}
5./usr/bin/testparm:主配置文件语法检查
6./sbin/mount.cifs:挂载
7./usr/bin/smbclient:
8./usr/bin/nmblookup:查找NetBIOS Name
9./usr/bin/smbtree:树形目录分布图
SAMBA配置流程:
1.服务器全局设置:工作组、NETBIOS Name、Password....
2.规划准备共享的目录参数
3.建立所需要的文件系统:
4.建立可用SAMBA账号
5.启动服务
注意:
1.smb.conf中#和;都是注释符号
2.不区分大小写,因为是Windows
[root@Centosszm ~]# grep -v '^[#|;]' /etc/samba/smb.conf
[global]
workgroup = MYGROUP
netbios name=
server string = Samba Server Version %v #说明文件
#display charset=自己服务器上面的显示编码
#unix charset=在Linux服务器上面的显示的编码 /etc/sysconfig/i18n
#dos charset=Windows客户端的编码 GB 2312 在SAMBA中称为cp936
#http://phorum.vbird.org/viewtopic.php?t=22001
# logs split per machine
log file = /var/log/samba/log.%m
# max 50KB per log file, then rotate
max log size = 50
security = user
#有user,share,domain
#share:不需要密码
#user:使用SAMBA服务器本身的密码数据库,密码数据库与下面的passdb backed有关
#domain:使用外部密码,也就是SAMBA是客户端之意,需要提供password server=ip的设值
passdb backend = tdbsam
#默认的文件放置到:/var/lib/samba/private/passwd.tdb
load printers = yes
cups options = raw
#obtain list of printers automatically on SystemV
[homes]
comment = Home Directories
browseable = no
writable = yes
#valid users=%s #valid users #是允许登录者
#%s:登录用户
#%m:Client NetBIOS Name
#%M:Client Name
#%L:SAMBA主机的NetBIOS Name
#%H:用户主目录
#%U:当前登录用户名称
#%g:登录用户的组名
#%h:SAMBA's hostname
#%I:Client's IP
#%T:当前日期与时间
[printers]
comment = All Printers #目录说明
path = /var/spool/samba
browseable = no
guest ok = no
writable = no #最后出现的那个设置值生效read only
printable = yes
#create mode与directory mode都是与权限相关
#writelist=User,Group
=========================
还可以利用SAMBA来修改/etc/passwd里面的人物的密码,不过这个时候就要需要"unix password sync"和"passwd porogram"这两个参数值的帮忙了。man smb.conf |
2.共享资源的相关参数设置:
3.smb.conf内的可用变量功能:
试验一:不需要密码的共享
NetBIOS Name几乎可以不用设置,因为现在我们都有IP进行网上邻居连接,不一定会用到这个参数设置值。
1.设置smb.conf配置文件
[root@Centosszm samba]# cat /etc/sysconfig/i18n
LANG="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16"
[root@Centosszm ~]# cd /etc/samba/
[root@Centosszm samba]# cp smb.conf smb.conf.back
[root@Centosszm samba]# grep -v '^[#|;]' smb.conf
[global]
workgroup = vbirdhouse
server string = Samba Server Version %v , this is szm's samba server
netbios name = MYSERVER
unix charset=utf8
display charset=utf8
dos charset=cp36
log file = /var/log/samba/log.%m
max log size = 50
security = share
passdb backend = tdbsam
load printers = no
cups options = raw
[temp]
comment=Temporary file space
browseable=yes
path=/tmp
writable=yes
guest ok=yes
[homes]
comment = Home Directories
browseable = no
writable = yes
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
3.用testparm检查smb.conf配置文件语法设置的正确性
[root@Centosszm samba]# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
init_iconv: Conversion from UTF-16LE to cp36 not supported
init_iconv: Attempting to replace with conversion from UTF-16LE to ASCII
init_iconv: Conversion from utf8 to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from utf8 to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to UTF-16LE not supported
init_iconv: Attempting to replace with conversion from ASCII to UTF-16LE
init_iconv: Conversion from cp36 to utf8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to utf8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to UTF8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to UTF-16BE not supported
init_iconv: Attempting to replace with conversion from ASCII to UTF-16BE
init_iconv: Conversion from cp36 to ASCII not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from UTF8 to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from UTF-16BE to cp36 not supported
init_iconv: Attempting to replace with conversion from UTF-16BE to ASCII
init_iconv: Conversion from ASCII to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
Processing section "[temp]"
Processing section "[homes]"
Processing section "[printers]"
init_iconv: Conversion from UTF-16LE to cp36 not supported
init_iconv: Attempting to replace with conversion from UTF-16LE to ASCII
init_iconv: Conversion from utf8 to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from utf8 to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to UTF-16LE not supported
init_iconv: Attempting to replace with conversion from ASCII to UTF-16LE
init_iconv: Conversion from cp36 to utf8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to utf8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to UTF8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to UTF-16BE not supported
init_iconv: Attempting to replace with conversion from ASCII to UTF-16BE
init_iconv: Conversion from cp36 to ASCII not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from UTF8 to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from UTF-16BE to cp36 not supported
init_iconv: Attempting to replace with conversion from UTF-16BE to ASCII
init_iconv: Conversion from ASCII to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
如果想要查看所有应用参数可以:
[root@szm samba]# testparm -v
[root@Centosszm samba]# netstat -tulnp |grep mbd
tcp 0 0 :::139 :::* LISTEN 4660/smbd
tcp 0 0 :::445 :::* LISTEN 4660/smbd
udp 0 0 172.16.128.255:137 0.0.0.0:* 4671/nmbd
udp 0 0 172.16.128.211:137 0.0.0.0:* 4671/nmbd
udp 0 0 192.168.111.255:137 0.0.0.0:* 4671/nmbd
udp 0 0 192.168.111.100:137 0.0.0.0:* 4671/nmbd
udp 0 0 192.168.179.255:137 0.0.0.0:* 4671/nmbd
udp 0 0 192.168.179.7:137 0.0.0.0:* 4671/nmbd
udp 0 0 0.0.0.0:137 0.0.0.0:* 4671/nmbd
udp 0 0 172.16.128.255:138 0.0.0.0:* 4671/nmbd
udp 0 0 172.16.128.211:138 0.0.0.0:* 4671/nmbd
udp 0 0 192.168.111.255:138 0.0.0.0:* 4671/nmbd
udp 0 0 192.168.111.100:138 0.0.0.0:* 4671/nmbd
udp 0 0 192.168.179.255:138 0.0.0.0:* 4671/nmbd
udp 0 0 192.168.179.7:138 0.0.0.0:* 4671/nmbd
udp 0 0 0.0.0.0:138 0.0.0.0:* 4671/nmbd
TCP:139,445(smb ports =139 445)
UDP:137,138
|
[root@Centosszm samba]# smbclient -L //127.0.0.1
init_iconv: Conversion from UTF-16LE to cp36 not supported
init_iconv: Attempting to replace with conversion from UTF-16LE to ASCII
init_iconv: Conversion from utf8 to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from utf8 to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to UTF-16LE not supported
init_iconv: Attempting to replace with conversion from ASCII to UTF-16LE
init_iconv: Conversion from cp36 to utf8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to utf8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to UTF8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to UTF-16BE not supported
init_iconv: Attempting to replace with conversion from ASCII to UTF-16BE
init_iconv: Conversion from cp36 to ASCII not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from UTF8 to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from UTF-16BE to cp36 not supported
init_iconv: Attempting to replace with conversion from UTF-16BE to ASCII
init_iconv: Conversion from ASCII to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from UTF-16LE to cp36 not supported
init_iconv: Attempting to replace with conversion from UTF-16LE to ASCII
init_iconv: Conversion from utf8 to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from utf8 to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to UTF-16LE not supported
init_iconv: Attempting to replace with conversion from ASCII to UTF-16LE
init_iconv: Conversion from cp36 to utf8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to utf8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to UTF8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to UTF-16BE not supported
init_iconv: Attempting to replace with conversion from ASCII to UTF-16BE
init_iconv: Conversion from cp36 to ASCII not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from UTF8 to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from UTF-16BE to cp36 not supported
init_iconv: Attempting to replace with conversion from UTF-16BE to ASCII
init_iconv: Conversion from ASCII to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
Enter root's password:
init_iconv: Conversion from UTF-16LE to cp36 not supported
init_iconv: Attempting to replace with conversion from UTF-16LE to ASCII
init_iconv: Conversion from utf8 to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from utf8 to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to UTF-16LE not supported
init_iconv: Attempting to replace with conversion from ASCII to UTF-16LE
init_iconv: Conversion from cp36 to utf8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to utf8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to UTF8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp36 to UTF-16BE not supported
init_iconv: Attempting to replace with conversion from ASCII to UTF-16BE
init_iconv: Conversion from cp36 to ASCII not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from UTF8 to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from UTF-16BE to cp36 not supported
init_iconv: Attempting to replace with conversion from UTF-16BE to ASCII
init_iconv: Conversion from ASCII to cp36 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
Domain=[VBIRDHOUSE] OS=[Unix] Server=[Samba 3.5.4-68.el6]
Sharename Type Comment
--------- ---- -------
temp Disk Temporary file space
IPC$ IPC IPC Service (Samba Server Version 3.5.4-68.el6 , this is szm's samba server)
Domain=[VBIRDHOUSE] OS=[Unix] Server=[Samba 3.5.4-68.el6]
Server Comment
--------- -------
MYSERVER Samba Server Version 3.5.4-68.el6 , this is szm'
Workgroup Master
--------- -------
VBIRDHOUSE MYSERVER
-L:仅查阅主机所提供共享的目录资源
-U:访问主机可使用资源
|
本地测试:
[root@Centosszm samba]# mount -t cifs //127.0.0.1/temp /mnt
Password:
[root@Centosszm samba]# touch /mnt/szm
#权限被压缩为nobody
[root@Centosszm samba]# ll /mnt/szm
-rw-r--r--. 1 nobody nobody 0 Apr 1 21:05 /mnt/szm
Windows 用//192.168.179.7/temp访问成功 |
需要账号密码才可登录的共享
SAMBA用户账号必须要存在于Linux系统当中(/etc/passwd),但是SAMBA的密码与Linux的密码文件并不相同。
[root@Centosszm samba]# grep -v '^[#|;]' smb.conf
[global]
workgroup = vbirdhouse
server string = Samba Server Version %v , this is szm's samba server
netbios name = MYSERVER
unix charset=utf8
display charset=utf8
dos charset=850
log file = /var/log/samba/log.%m
max log size = 50
security = user
passdb backend = tdbsam #密码放置于/var/lib/samba/private内
load printers = no
cups options = raw
[homes]
comment = Home Directories
browseable = no #除了自己外,其他人不可见
writable = yes
create mode=0664
directory mode=0775
[project]
comment=smbuser's project
path=/home/project
browseable=yes
writable=yes
write list=@users
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
[root@Centosszm samba]# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[project]"
Processing section "[printers]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[global]
dos charset = 850
unix charset = utf8
display charset = utf8
workgroup = VBIRDHOUSE
netbios name = MYSERVER
server string = Samba Server Version %v , this is szm's samba server
log file = /var/log/samba/log.%m
max log size = 50
load printers = No
cups options = raw
[homes]
comment = Home Directories
read only = No
create mask = 0664
directory mask = 0775
browseable = No
[project]
comment = smbuser's project
path = /home/project
write list = @users
read only = No
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No
[root@Centosszm samba]# mkdir /home/project
[root@Centosszm samba]# chgrp users /home/project
[root@Centosszm samba]# chmod 2770 /home/project
[root@Centosszm samba]# ll -d /home/project
drwxrws---. 2 root users 4096 Apr 1 21:57 /home/project
SAMBA要访问Linux文件系统时,都是需要以Linux下的UID和GID为准则的。 |
[root@Centosszm samba]# useradd -G users smb1
[root@Centosszm samba]# useradd -G users smb2
[root@Centosszm samba]# useradd -G users smb3
[root@Centosszm samba]# echo password | passwd --stdin smb1
Changing password for user smb1.
passwd: all authentication tokens updated successfully.
[root@Centosszm samba]# echo password | passwd --stdin smb2
Changing password for user smb2.
passwd: all authentication tokens updated successfully.
[root@Centosszm samba]# echo password | passwd --stdin smb3
Changing password for user smb3.
passwd: all authentication tokens updated successfully.
[root@szm samba]# pdbedit --help
Usage: [OPTION...]
-L, --list list all users #列出相关信息
-v, --verbose be verbose #列出更多信息
-w, --smbpasswd-style give output in smbpasswd style #使用旧版格式显示数据,与-L一起使用
-u, --user=USER use username #
-N, --account-desc=STRING set account description
-f, --fullname=STRING set full name
-h, --homedir=STRING set home directory
-D, --drive=STRING set home drive
-S, --script=STRING set logon script
-p, --profile=STRING set profile path
-I, --domain=STRING set a users' domain
-U, --user SID=STRING set user SID or RID
-M, --machine SID=STRING set machine SID or RID
-a, --create create user #
-r, --modify modify user #
-m, --machine account is a machine account #后面接的是机器的代码,与Domain Moel有关
-x, --delete delete user #
-b, --backend=STRING use different passdb backend as default
backend
-i, --import=STRING import user accounts from this backend
-e, --export=STRING export user accounts to this backend
-g, --group use -i and -e for groups
-y, --policies use -i and -e to move account policies
between backends
--policies-reset restore default policies
-P, --account-policy=STRING value of an account policy (like maximum
password age)
-C, --value=LONG set the account policy to this value
-c, --account-control=STRING Values of account control
--force-initialized-passwords Force initialization of corrupt password
strings in a passdb backend
-z, --bad-password-count-reset reset bad password count
-Z, --logon-hours-reset reset logon hours
--time-format=STRING The time format for time parameters
-t, --password-from-stdin get password from standard in
-K, --kickoff-time=STRING set the kickoff time
Help options:
-?, --help Show this help message
--usage Display brief usage message
Common samba options:
-d, --debuglevel=DEBUGLEVEL Set debug level
-s, --configfile=CONFIGFILE Use alternate configuration file
-l, --log-basename=LOGFILEBASE Base name for log files
-V, --version Print version
--option=name=value Set smb.conf option from command line
[root@Centosszm samba]# pdbedit -a -u smb1
new password:
retype new password:
Unix username: smb1
NT username:
Account Flags: [U ]
User SID: S-1-5-21-3409024784-2675410203-1103496359-1000
Primary Group SID: S-1-5-21-3409024784-2675410203-1103496359-513
Full Name:
Home Directory: \\myserver\smb1
HomeDir Drive:
Logon Script:
Profile Path: \\myserver\smb1\profile
Domain: MYSERVER
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: never
Kickoff time: never
Password last set: Mon, 01 Apr 2013 22:09:31 CST
Password can change: Mon, 01 Apr 2013 22:09:31 CST
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
[root@Centosszm samba]# pdbedit -L
smb1:1004:
smb3:1006:
smb2:1005:
[root@Centosszm samba]# pdbedit -x -u smb3 #删除用户smb3
[root@Centosszm samba]# pdbedit -Lw
smb1:1004:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:8846F7EAEE8FB117AD06BDD830B7586C:[U ]:LCT-5159951B:
smb2:1005:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:7CE21F17C0AEE7FB9CEBA532D0546AD6:[U ]:LCT-51599537:
[root@Centosszm samba]# /etc/init.d/smb restart
Shutting down SMB services: [ OK ]
Starting SMB services: [ OK ]
[root@Centosszm samba]# /etc/init.d/nmb restart
Shutting down NMB services: [ OK ]
Starting NMB services: [ OK ]
[root@Centosszm samba]# smbclient -L //127.0.0.1 #因为需要密码,没写密码看不到共享
Enter root's password:
Anonymous login successful
Domain=[VBIRDHOUSE] OS=[Unix] Server=[Samba 3.5.4-68.el6]
Sharename Type Comment
--------- ---- -------
project Disk smbuser's project
IPC$ IPC IPC Service (Samba Server Version 3.5.4-68.el6 , this is szm's samba server)
Anonymous login successful
Domain=[VBIRDHOUSE] OS=[Unix] Server=[Samba 3.5.4-68.el6]
Server Comment
--------- -------
MYSERVER Samba Server Version 3.5.4-68.el6 , this is szm'
Workgroup Master
--------- -------
VBIRDHOUSE
[root@Centosszm samba]# smbclient -L //127.0.0.1 -U smb1
Enter smb1's password:
Domain=[VBIRDHOUSE] OS=[Unix] Server=[Samba 3.5.4-68.el6]
Sharename Type Comment
--------- ---- -------
project Disk smbuser's project
IPC$ IPC IPC Service (Samba Server Version 3.5.4-68.el6 , this is szm's samba server)
smb1 Disk Home Directories #只看到自己的目录
Domain=[VBIRDHOUSE] OS=[Unix] Server=[Samba 3.5.4-68.el6]
Server Comment
--------- -------
MYSERVER Samba Server Version 3.5.4-68.el6 , this is szm'
Workgroup Master
--------- -------
VBIRDHOUSE MYSERVER
[root@Centosszm samba]# smbclient -L //127.0.0.1 -U smb2
Enter smb2's password:
Domain=[VBIRDHOUSE] OS=[Unix] Server=[Samba 3.5.4-68.el6]
Sharename Type Comment
--------- ---- -------
project Disk smbuser's project
IPC$ IPC IPC Service (Samba Server Version 3.5.4-68.el6 , this is szm's samba server)
smb2 Disk Home Directories #只看到自己的目录
Domain=[VBIRDHOUSE] OS=[Unix] Server=[Samba 3.5.4-68.el6]
Server Comment
--------- -------
MYSERVER Samba Server Version 3.5.4-68.el6 , this is szm'
Workgroup Master
--------- -------
VBIRDHOUSE MYSERVER
[root@Centosszm samba]# mount -t cifs //127.0.0.1/smb1 /mnt -o username=smb1
Password:
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[root@Centosszm samba]#
[root@Centosszm samba]# setsebool -P samba_enable_home_dirs=1
[root@Centosszm samba]# mount -t cifs //127.0.0.1/smb1 /mnt -o username=smb1
Password:
因为之前用Share的方式共享过文件,Windows也连接了这个服务器。如果上个连接没有关闭,这个时间与服务器的连接就会出错。因些,在连接上服务器前,因当断开所连接的网络驱动器再连接服务器即可://192.168.179.7/smb1。 |