您当前的位置: 首页 > 学无止境 > 心得笔记 网站首页心得笔记
马哥linux运维学习笔记-samba之一
发布时间:2019-03-08 12:50:31编辑:雪饮阅读()
安装samba3x
[root@mail ~]# rpm -e samba-client samba-common
这两个包要一起安装,否则每个单独安装就会互相各自依赖
[root@mail ~]# rpm -ivh /test/Server/samba3x-winbind-3.5.10-0.107.el5.i386.rpm /test/Server/samba3x-common-3.5.10-0.107.el5.i386.rpm
[root@mail ~]# rpm -ivh /test/Server/samba3x-3.5.10-0.107.el5.i386.rpm
[root@mail ~]# rpm -ivh /test/Server/samba3x-client-3.5.10-0.107.el5.i386.rpm
创建samba共享
配置
编辑配置文件'/etc/samba/smb.conf'在其末尾添加如下:
[tools]
comment = Share Testing
path = /share/test
public = yes
writable =yes
[tools]:共享名称可自定义,这里设置为tools
path:共享的目录
public:配置访问权限是否public
writable:配置是否具有写入权限
在该配置文件中还可以自定义配置工作组名,如:
workgroup = WORKGROUP
创建共享目录
[root@mail ~]# mkdir /share/test
配置文件语法测试
[root@mail ~]# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[tools]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[global]
server string = Samba Server Version %v
log file = /var/log/samba/log.%m
max log size = 50
cups options = raw
[homes]
comment = Home Directories
read only = No
browseable = No
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No
[tools]
comment = Share Testing
path = /share/test
read only = No
guest ok = Yes
创建系统用户并将其添加为samba账户
[root@mail ~]# useradd eucalyptus
[root@mail ~]# passwd eucalyptus
Changing password for user eucalyptus.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
添加为samba账户,注意这里的密码必须不同于系统用户的密码
[root@mail ~]# smbpasswd -a eucalyptus
New SMB password:
Retype new SMB password:
设置读写权限
[root@mail ~]# setfacl -m u:eucalyptus:rwx /share/test/
启动服务
[root@mail ~]# service smb start
Starting SMB services: [ OK ]
windows连接samba共享服务测试
在windows上挂载samba即映射网络驱动器
为你的网络驱动器盘符起一个名字,所以随便选择这里可选择的盘符即可,然后填写上你的samba服务地址,如' \\192.168.128.130\tools',然后点击'使用其他用户名进行连接'
然后关闭窗口并回到'我的电脑'就会发现新增了一个设备,可以直接点击进去
关键字词:linux,samba