要求:

  1. create vnc service for win7 access it via vnc viewer.
  2. 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.
  3. on this 1TB disk, create three folder with name: 1) "temp" 2) "pet_qcbak" 3) "pet_granny"
  4. 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的更多相关文章

  1. 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 ...

  2. Samba: Server setup..

    To make samba shard folder permission clear, there are 3 kind of permission need to be paid attentio ...

  3. samba server 设置

     samba server  设置yum install samba.x86_64systemctl start smb.servicesystemctl enable smb.servicesamb ...

  4. 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 ...

  5. 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.  ...

  6. 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 ...

  7. Samba Server possible problem and solving

    Configured samba server at RHEL7, problem encountered and solved. 1, yum install samba*, RHEL7 syste ...

  8. CentOS 7 samba server 配置

    samba是linux上的文件共享服务软件,相当与Windows上的共享文件夹,当然也是要在同一网段上的. 当前用的版本是4.4.4,好吧!下面介绍怎么去安装配置它,here we go! 1. 安装 ...

  9. [转]Android与电脑局域网共享之:Samba Server

    大家都有这样的经历,通过我的电脑或网上邻居访问另一台计算机上的共享资源,虽然电脑和手机之间可以有多种数据传输方式,但通过Windows SMB方式进行共享估计使用的人并不是太多,下面我就简单介绍一下, ...

随机推荐

  1. SharePreference 工具类封装

    import java.util.List;import java.util.Map;import java.util.Set;import com.alibaba.fastjson.JSON;imp ...

  2. 伸缩盒 Flexible Box(新)

    flex   flex-grow    flex-shrink   flex-basis  flex-flow   flex-direction   flex-wrap  align-content  ...

  3. 移动端特殊css样式

    一般会用normalize.css或者reset.css重置样式 移动端特殊css样式 去除ios 按钮按下的默认高亮效果 -webkit-tap-highlight-color : none; io ...

  4. ue4 UE4Editor.lib找不到

    PublicDependencyModuleNames里加了Launch后,会导致链接UE4Editor.lib, 但这个文件在预编版的引擎里是没有的(奇怪的是自己编译引擎的话会有) 如果只是要头文件 ...

  5. FreeBSD_11-系统管理——{Part_9 - SubVersion}

    一.使用 svn / svnlite 代替 freebsd-update 及 portsnap 等常规工具更新系统及 ports 源码 二.安装可信 ca 机构列表 cd /usr/ports/sec ...

  6. handsontable组件和jqwidgets(jqxdragdrop组件)在一个页面产生调整宽高bug

    修改handsontable.full.js handsontable绑定的"mouseup"事件,默认是window区域太大.引起冲突.

  7. winform初学

    一.建立winform工程项目

  8. ES6中的var let const应如何选择

    javascript世界里面的每个人都在说有关ECMAScript 6 (ES6,也称作ES 2015)的话题,对象的巨大变化 ( 类 , super() , 等), 函数 (默认参数等), 以及模块 ...

  9. cannot determine the location of the vs common tools folder

    问题:打开"VS2010开发人员命令提示后",上面提示"cannot determine the location of the vs common tools fold ...

  10. Gray Code

    Gray Code The gray code is a binary numeral system where two successive values differ in only one bi ...