首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

samba共享服务安装,开发可用映射

1987年,微软公司和英特尔公司共同制定了SMB(Server Messages Block,服务器消息块)协议,旨在解决局域网内的文件或打印机等资源的共享问题,这也使得在多个主机之间共享文件变得越来越简单。到了1991年,当时还在读大学的Tridgwell为了解决Linux系统与Windows系统之间的文件共享问题,基于SMB协议开发出了SMBServer服务程序。这是一款开源的文件共享软件,经过简单配置就能够实现Linux系统与Windows系统之间的文件共享工作。当时,Tridgwell想把这款软件的名字SMBServer注册成为商标,但却被商标局以SMB是没有意义的字符而拒绝了申请。后来Tridgwell不断翻看词典,突然看到一个拉丁舞蹈的名字—Samba,而且这个热情洋溢的舞蹈名字中又恰好包含了“SMB”,于是Samba服务程序的名字由此诞生(见图所示)。Samba服务程序现在已经成为在Linux系统与Windows系统之间共享文件的最佳选择。

03

CentOS 7搭建SMB服务「建议收藏」

第一步:安装samba服务 》yum install samba 第二步:启动samba服务 》systemctl start smb 查看samba的状态 》systemctl status smb 看到Active就说明在运行中了 第三步:关闭防火墙 》systemctl stop firewalld.service //停止服务 》systemctl disable firewalld.service //关闭开机启动 同时还有这一步 设置SELINUX=disabled(需要重启电脑) # vi /etc/selinux/config文件中设置SELINUX=disabled ,然后重启服务器。 第四步:需要添加一个用户来访问文件 》useradd lcd //添加用户 》passwd lcd //修改密码 创建samba用户 》smbpasswd -a lcd 第五步:修改samba的配置文件 》vi /etc/samba/smb.conf //进入配置文件 5.1将global中进行一下全局配置更改: workgroup = WORKGROUP//定义工作组,也就是windows中的工作组概念 security = user //安全认证方式采用user方式 ntlm auth = yes //否则windows7访问用户会认证失败 5.2在conf中添加新的用户配置(让4的配置生效) [lcd] path = /cloud/lcd //共享目录 browsable =yes writable = yes //目录可读可写 read only = no 修改后的smb.conf如下: [global] workgroup = WORKGROUP security = user passdb backend = tdbsam printing = cups printcap name = cups load printers = yes cups options = raw ntlm auth = yes [homes] comment = Home Directories valid users = %S, %D%w%S browseable = No read only = No inherit acls = Yes [printers] comment = All Printers path = /var/tmp printable = Yes create mask = 0600 browseable = No [print$] comment = Printer Drivers path = /var/lib/samba/drivers write list = @printadmin root force group = @printadmin create mask = 0664 directory mask = 0775 [lcd] path = /cloud/lcd browsable =yes writable = yes read only = no 第六步:设置想要共享目录的文件权限 给共享目录添加写权限,这样可以从windows向linux中写入文件。比如我这里设置\home为共享目录,那在终端输入以下命令即可 chmod -R 777 /cloud/lcd (可写 w=4 可读 r=2 可执行 x=1 ) 第七步:重启samba服务 》systemctl restart smb

03

ACMSGURU 276 - Andrew's Troubles

Famous Berland ACM-ICPC team Anisovka consists of three programmers: Andrew, Michael and Ilya. A long time ago, during the first few months the team was founded, Andrew was very often late to the trainings and contests. To stimulate Andrew to be more punctual, Ilya and Andrew decided to introduce a new rule for team participants. If somebody is late (i.e. comes at least one second after appointed time) he owes a cup of tea to other team members. If he is late for 5 minutes, he owes two cups of tea. If he is late for 15 minutes, he owes three cups of tea. And if he is late for 30 minutes or more, he owes 4 cups of tea. The training starts at the time S (counted in seconds, from some predefined moment of time) and Andrew comes at the time P (also in seconds, counted from the same moment of time).

02
领券