samba server install
要求:
- create vnc service for win7 access it via vnc viewer.
- 1TB disk for this Centos PC is used as Samba server, which used to share files. and nsn-intra user could access the folder via their personal win7 pc with map network drive.
- on this 1TB disk, create three folder with name: 1) "temp" 2) "pet_qcbak" 3) "pet_granny"
- on folder temp, the file rule is that delete the file after it was created 2 weeks later.
[root@localhost home]# rpm -qa | grep samba 已经安装的软件包,有些可以选择不安装
samba-libs-4.2.10-7.el7_2.x86_64
samba-4.2.10-7.el7_2.x86_64
samba-winbind-clients-4.2.10-7.el7_2.x86_64
samba-common-libs-4.2.10-7.el7_2.x86_64
samba-vfs-glusterfs-4.2.10-7.el7_2.x86_64
samba-common-4.2.10-7.el7_2.noarch
samba-test-libs-4.2.10-7.el7_2.x86_64
samba-winbind-modules-4.2.10-7.el7_2.x86_64
samba-pidl-4.2.10-7.el7_2.noarch
samba-winbind-krb5-locator-4.2.10-7.el7_2.x86_64
samba-client-4.2.10-7.el7_2.x86_64
samba-winbind-4.2.10-7.el7_2.x86_64
samba-dc-4.2.10-7.el7_2.x86_64
samba-devel-4.2.10-7.el7_2.x86_64
samba-client-libs-4.2.10-7.el7_2.x86_64
samba-dc-libs-4.2.10-7.el7_2.x86_64
samba-test-devel-4.2.10-7.el7_2.x86_64
samba-common-tools-4.2.10-7.el7_2.x86_64
samba-python-4.2.10-7.el7_2.x86_64
samba-test-4.2.10-7.el7_2.x86_64
[root@localhost home]# egrep -v "(^;|^#|^$)" /etc/samba/smb.conf 配置权限共享目录
[global]
workgroup = LinuxSir
server string = Linux Samba Server Sir
# log files split per-machine:
log file = /var/log/samba/log.%m
# maximum size of 50KB per log file, then rotate:
max log size = 50
security = user
passdb backend = tdbsam
# the following login script name is determined by the machine name
# (%m):
# the following login script name is determined by the UNIX user used:
# use an empty path to disable profile support:
# various scripts can be used on a domain controller or a stand-alone
# machine to add or delete corresponding UNIX accounts:
load printers = yes
cups options = raw
# obtain a list of printers automatically on UNIX System V systems:
[homes]
comment = Home Directories
browseable = no
writable = yes
[public]
comment = public
path = /sambadata
public = yes
writable = yes[root@localhost home]# fdisk -l | grep sda //sda2作为共享硬盘
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes, 1953525168 sectors
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 1953525167 976249560 83 Linux
[root@localhost home]# blkid /dev/sda2 //获取uuid
/dev/sda2: UUID="1584f527-57d5-4d6e-a7f8-a29c6f069bdf" TYPE="xfs"
[root@localhost home]# cat /etc/fstab | grep "/sambadata" //实现开机自动挂载
UUID=1584f527-57d5-4d6e-a7f8-a29c6f069bdf /sambadata xfs defaults 0 0
[root@localhost home]#[root@localhost ~]# mkdir -p /sambadata/{temp,pet_granny,pet_qcbak} //新建共享文件夹
[root@localhost sambadata]# id samba //用户id
uid=1001(samba) gid=1001(samba) groups=1001(samba)
[root@localhost sambadata]# smbpasswd -a samba //转换系统用户为samba用户
New SMB password:
Retype new SMB password:
[root@localhost sambadata]# pdbedit -L //查看
samba:1001: !!!!!!!!!
请关闭防火墙
centos7
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
centos6.x
service iptables stop
chkconfig --del iptables
chkconfig iptables off 请关闭selinux:
vim /etc/selinux/conf
SELINUX=disabled //修改为disabled
setenforce 0 //临时关闭实现定期删出2周前的文件:[root@localhost sambadata]# vim /usr/local/bin/clear //添加执行脚本命令
#!/bin/bash
find /sambadata/temp/ -mtime +14 -name "*.*" -exec rm -rf {} \;
[root@localhost sambadata]# chmod +x /usr/local/bin/clear //执行权限
[root@localhost sambadata]# crontab -e //执行自动化删除任务
* 2 * * * /usr/local/bin/clear
测试:
samba server install的更多相关文章
- How to install Samba server on Ubuntu 12.04
Part 1: Configuring anonymous share with samba server To install the samba package,enter the followi ...
- Samba: Server setup..
To make samba shard folder permission clear, there are 3 kind of permission need to be paid attentio ...
- samba server 设置
samba server 设置yum install samba.x86_64systemctl start smb.servicesystemctl enable smb.servicesamb ...
- The Guideline of Setting Up Samba Server on linux(Ubuntu)
The Guideline of Setting Up Samba Server on linux(Ubuntu) From terminate command window, install the ...
- How to configure Samba Server share on Debian 9 Stretch Linux
Lubos Rendek Debian 13 June 2017 Contents 1. Objective 2. Operating System and Software Versions 3. ...
- How To Configure SAMBA Server And Transfer Files Between Linux & Windows
If you are reading this article it means you have a network at home or office with Windows and Linux ...
- Samba Server possible problem and solving
Configured samba server at RHEL7, problem encountered and solved. 1, yum install samba*, RHEL7 syste ...
- CentOS 7 samba server 配置
samba是linux上的文件共享服务软件,相当与Windows上的共享文件夹,当然也是要在同一网段上的. 当前用的版本是4.4.4,好吧!下面介绍怎么去安装配置它,here we go! 1. 安装 ...
- [转]Android与电脑局域网共享之:Samba Server
大家都有这样的经历,通过我的电脑或网上邻居访问另一台计算机上的共享资源,虽然电脑和手机之间可以有多种数据传输方式,但通过Windows SMB方式进行共享估计使用的人并不是太多,下面我就简单介绍一下, ...
随机推荐
- SQL Server 列存储性能调优(翻译)
原文地址:http://social.technet.microsoft.com/wiki/contents/articles/4995.sql-server-columnstore-performa ...
- mysql通过data文件恢复数据库的方式
1.首先定位mysql的my.ini配置文件,查找datadir的位置 #Path to the database rootdatadir="C:/ProgramData/MySQL/MyS ...
- rpm常用命令
* 手动安装 rpm 包 `rpm-ivh xxxxx.rpm` 参数: --force 即使覆盖其他包的文件也没强迫安装 --nodeps 即使依赖包没安装,也被强制安装 * 查看 rp ...
- mysql三种注释方法
SELECT * from test;#test表select * from user;-- 用户表select * from tb_test_paper;/*试卷表*/
- link和import的区别
1.link是xhtml标签,除了可以加载css外,还可以加载定义其他的事务:@import只属于css的范畴,只能加载css: 2.link引用CSS时,在页面载入时同时加载:@import需要页面 ...
- android源码环境下用mmm/mm编译模块,输出编译log到文件的方法
android源码环境下用mmm/mm编译模块,输出编译log到文件的方法 1,在android目录下直接用mmm命令编译, log信息保存在android目录下 mmm packages/apps/ ...
- Spring注解@Component、@Repository、@Service、@Controller区别 .
Spring 2.5 中除了提供 @Component 注释外,还定义了几个拥有特殊语义的注释,它们分别是:@Repository.@Service 和 @Controller.在目前的 Spring ...
- 文件消息的简单样式demo
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- 说说Python中的闭包 - Closure
转载自https://segmentfault.com/a/1190000007321972 Python中的闭包不是一个一说就能明白的概念,但是随着你往学习的深入,无论如何你都需要去了解这么一个东西 ...
- Sublime Text 用法小记
复制当前行: Ctrl + Shift + D 上下移动行: Ctrl + Shift + ↑/↓ 选中行部分: Crtl + Shift + ←/→ 格式化json: Ctrl + Alt + J