要求:

  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. php emoji处理微信表情

    使用 https://github.com/iamcal/php-emoji 添加下面的函数到代码中 function utf8_bytes($cp){ if ($cp > 0x10000){ ...

  2. sap 常用表

    MM    表名 EBAN 采购申请

  3. jquery mobile RedirectToAction url地址不更新

    使用asp.net mvc 和 jquery mobile 开发手机版网站 发起一个post请求,在第一个action里做了处理,用RedirectToAction 跳转到其他action继续处理后, ...

  4. 面试题<初级>

    INTERVIEW .markdown-body ul pre code { background:red; font-size:40px; } @code-char:"```" ...

  5. MYSQL常用内置函数详解说明

    函数中可以将字段名当作变量来用,变量的值就是该列对应的所有值:在整理98在线字典数据时(http://zidian.98zw.com/),有这要一个需求,想从多音字duoyinzi字段值提取第一个拼音 ...

  6. 漫谈Linux内核哈希表(1)

    关于哈希表,在内核里设计两个很重要的数据结构:    哈希链表节点: 点击(此处)折叠或打开 .x [include/linux/types.h]*/ struct hlist_node { stru ...

  7. IP地址子网掩码主机地址网络号主机号

    (1)子网掩码1所对应的位为网络号位 而所对应的位为主机号位 IP地址+子网掩码=网络号: IP地址+子网掩码(反码)=主机号. (2)主机号中的m位被用来表示网络号了,也就是子网号,将0-255划分 ...

  8. PHP中$_SERVER的详细参数

    $_SERVER['PHP_SELF'] #当前正在执行脚本的文件名,与 document root相关. $_SERVER['argv'] #传递给该脚本的参数. $_SERVER['argc']  ...

  9. PS:蓝天白云的制作

    方法一: 1.新建(ctrl+N),根据自己的需求设置画面大小: 2.设置前景色为蓝天颜色,alt+delete,填充为天空蓝颜色: 3.滤镜-渲染-云彩,得出蓝天白云效果: 4.根据需求再调整亮度. ...

  10. ios 的touch事件分析

    IOS之触摸事件和手势   13.1 事件概述 13.2 触摸事件 13.3 手势 13.1 事件概述 事件是当用户手指触击屏幕及在屏幕上移动时,系统不断发送给应用程序的对象. 系统将事件按照特定的路 ...