要求:

  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. redis对比其余数据库

    Redis属于常见的NoSQL数据库或者说非关系数据库:Redis不使用表,她的数据库也不会预定义或者强制去要求用户对Redis存储的不同数据进行关联. 常见数据库对比: 和高性能键值缓存服务器mem ...

  2. final阶段140字评论1

    1.约跑app         此次演讲增加了摄像头演示的功能,所以界面可以看得更清楚,演示的比上次完整,流畅,约跑这个项目感觉对于我们颇有使用价值,大家现在都热爱跑                 ...

  3. Mapped Statements collection does not contain value fo

    Mapped Statements collection does not contain value for后面是什么类什么方法之类的: 错误原因有几种: 1.mapper.xml中没有加入name ...

  4. mongkeyrunner实现循环随机输入值的方法

    from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImagedevice= MonkeyRunner.waitF ...

  5. mock测试框架Mockito

    无论是敏捷开发.持续交付,还是测试驱动开发(TDD)都把单元测试作为实现的基石.随着这些先进的编程开发模式日益深入人心,单元测试如今显得越来越重要了.在敏捷开发.持续交付中要求单元测试一定要快(不能访 ...

  6. Linq To Nhibernate 性能优化(入门级)

    最近都是在用Nhibernate和数据库打交道,说实话的,我觉得Nhibernate比Ado.Net更好用,但是在对于一些复杂的查询Nhibernate还是比不上Ado.Net.废话不多说了,下面讲讲 ...

  7. [04]APUE:文件与目录

    [a] stat / lstat / fstat #include <sys/stat.h> int stat(const char *restrict pathname, struct ...

  8. 手机safari图片上传竖变横处理

    在手机safari上传图片时,竖着的照片会变成横着的照片,以下程序片段利用图片exif信息把图片旋转回去,代码抄自php.net官网. http://php.net/manual/zh/functio ...

  9. Q_OBJECT

    所有QObject的派生类在官方文档中都推荐在头文件中放置宏Q_OBJECT,那么该宏到底为我们做了哪些工作?在qobjectdef.h中有下面的代码: #define Q_OBJECT \ publ ...

  10. silverLight--绑定数据dataGrid

    后台代码编写 ,为表格绑定数据: using System; using System.Collections.Generic; using System.Linq; using System.Net ...