# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it. [global]
workgroup = SAMBA
security = user passdb backend = tdbsam printing = cups
printcap name = cups
load printers = yes
cups options = raw [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
[xxk_data]
comment='信息科专用'
path=/home/data
public=no
writable=yes

https://www.cnblogs.com/yinheyi/p/6269576.html

安装主要采用yum进行

采用阿里的base+epel

yum -y install samba
systemctl enable smb
mkdir -p /home/data
useradd smbuser
pdbedit -a -u smbuser
cd /home/
chown -R smbuser.smbuser data/
vim /etc/samba/smb.conf
[xxk_data]
comment='信息科专用'
path=/home/data
public=no
writable=yes
systemctl restart smb

如果比较卡慢的话请注意

请按照/etc/hosts和/etc/sysconfig/network文件进行修改

查看目录的大小

du -sh *

# add at 18-09-30 解决xp无法访问samba服务的问题

当遇到xp电脑无法打开samba部署的公共盘时

查阅有的资料认为xp不支持高版本的samba服务

为此修改配置文件

[global]
workgroup = SAMBA
security = user

passdb backend = tdbsam

printing = cups
printcap name = cups
load printers = yes
cups options = raw
ntlm auth = yes

修改后的配置文件为:

# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it. [global]
workgroup = SAMBA
security = user passdb backend = tdbsam printing = cups
printcap name = cups
load printers = yes
cups options = raw
ntlm auth = 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
[xxk_data]
comment='信息科专用'
path=/home/data
public=no
writable=yes

###新增定时任务校对时间

内网时间服务器地址为172.20.91.54

echo '#time sync by nodchen at 18-09-30' >/var/spool/cron/root
echo '*/5 * * * * /usr/sbin/ntpdate timeserver >/dev/null 2>&1' >/var/spool/cron/root
crontab -l

###新增处理图形界面休眠问题

以下功能待测试

[root@samba ~]# cd /etc/X11/
[root@samba X11]# cat xorg.conf
Section "ServerFlags"
       Option "BlankTime" "0"
       Option "StandbyTime" "0"
       Option "SuspendTime" "0"
       Option "OffTime" "0"
EndSection
Section "Monitor"
       Option "DPMS" "false"
EndSection

# add end 18-09-30

### add at 18-10-02 centos7关于图形界面的处理

1   当安装了图形界面的情况处理

#查看开机启动模式为图形还是命令行
[root@nodchen ~]# systemctl get-default
graphical.target

#开机以命令行界面启动
[root@nodchen ~]# systemctl set-default multi-user.target
Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/multi-user.target.

#开机以图形界面启动
systemctl set-default graphical.target

### add end 18-10-02

### add at 18-10-05 新增centos安装部署优化脚本

 #-------------------------------------------------------------------------------
#
# 系统部署完毕后运行规范化脚本
# Author:nod
# Date:18-08-09
# $1 ip $2 gateway $3 hostname
# centOS 7.4
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# 网卡优化
#-------------------------------------------------------------------------------
>/etc/sysconfig/network-scripts/ifcfg-eth0
cat >> /etc/sysconfig/network-scripts/ifcfg-eth0 <<EOF
TYPE=Ethernet
BOOTPROTO=none
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=$1
NETMASK=255.255.255.0
GATEWAY=$2
DNS1=223.5.5.5
EOF #-------------------------------------------------------------------------------
# 关闭防火墙
#-------------------------------------------------------------------------------
systemctl disable firewalld.service
systemctl stop firewalld
setenforce 0
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config #-------------------------------------------------------------------------------
# 修改主机名
#-------------------------------------------------------------------------------
hostnamectl set-hostname $3 #-------------------------------------------------------------------------------
# yum优化
# 适用于阿里base+epel
#-------------------------------------------------------------------------------
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum -y install wget wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
yum install -y bash-completion.noarch
yum install -y net-tools vim lrzsz wget tree screen lsof tcpdump
systemctl stop postfix.service
systemctl disable postfix.service #-------------------------------------------------------------------------------
# ssh优化
#-------------------------------------------------------------------------------
sed -i 's@#UseDNS no@UseDNS no@g' /etc/ssh/sshd_config
sed -i 's#GSSAPIAuthentication yes#GSSAPIAuthentication no#g' /etc/ssh/sshd_config
systemctl restart sshd #-------------------------------------------------------------------------------
# 重启后检查 没问题就关机 至此部署完毕
#-------------------------------------------------------------------------------
reboot

### at end 18-10-05

Centos 7.4 安装samba服务的更多相关文章

  1. Centos 7 下安装 samba 服务

    yum install samba 配置文件在:/etc/samba/smb.conf [global] #添加下面这句 map to guest = Bad User #这个选项是保证匿名访问! # ...

  2. 安装Samba服务让宿主机和虚拟机共享文件

    安装 samba 服务器之后,很方便的实现 Windows 和 Linux 进行通信. 安装步骤: 1 .在 Ubuntu 系统下面安装 samba 服务: $ sudo apt-get instal ...

  3. [转载]centos下yum安装samba及配置

    centos下yum安装samba及配置 在我们使用 Windows 作为客户机的时候,通常有文件.打印共享的需求.作为Windows 网络功能之一,通常可以在 Windows 客户机之间通过Wind ...

  4. CentOS 7 下安装 LEMP 服务(nginx、MariaDB/MySQL 和 php)

    原文 CentOS 7 下安装 LEMP 服务(nginx.MariaDB/MySQL 和 php) LEMP 组合包是一款日益流行的网站服务组合软件包,在许多生产环境中的核心网站服务上起着强有力的作 ...

  5. CentOS 7.4安装telnet服务端

    CentOS 7.4安装telnet服务端 安装xinetd服务 # yum -y install xinetd 安装telnet-server # yum -y install telnet-ser ...

  6. CentOS 7 安装samba服务

    STEP 1. 安装 #安装 [root@study ~]yum install smaba [root@study ~]systemctl start smb nmb STEP 2. 建立共享目录以 ...

  7. centos安装samba服务和配置

    1.samba简介 Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成.SMB(Server Messages Block,信息服务块)是一种在局域网上共享 ...

  8. CentOS 6.3 安装 samba 共享(转)

    PHP环境在linux下,但是开发的时候用的是windows,于是我用了samba将linux的一个目录共享,然后在windows上做映射,这样就可以直接在windows下编辑linux上的文件了 首 ...

  9. Raspberry Pi3 ~ 安装samba服务

    文章转载自此博文 1. sudo apt-get install samba 如果出现错误提示,则需要先执行sudo apt-get update,再重新执行sudo apt-get install ...

随机推荐

  1. MVVM在WPF中应用(1)

    在软件行业浸润了这么多年,第一次在MES的工厂里从事软件开发. 在这里的感觉就是安静.宽松,比在那些专门以软件为主的企业中轻松自在.在这里的第一个项目是关于数据的导入和导出,还有数据的比较这些功能. ...

  2. mysqldump-1045

    mysqldump: [Warning] Using a password on the command line interface can be insecure.mysqldump: Got e ...

  3. redmine添加自定义问题状态

    使用管理员登录 首先添加一个问题状态:挂起 创建之后,会出现不显示这个先状态的情况,所以我们还需要进行其他的配置.注意,先取消只显示被次跟踪标签使用的状态,然后点击编辑,才会看到新创建的挂起状态 然后 ...

  4. scanf() gets() fgets()使用注意事项

    1.scanf() 遇到'\n'停止从输入缓冲区中接收,接收完后‘\n’还存在于缓冲区中.当输入的字符数少于缓冲区大小时,字符后面有自动补上‘\0’,当输入字符大于缓冲区时,也直接拷贝到缓冲中,因此缓 ...

  5. Linux系统运维故障排查

    一.思路 1.处理问题要求 2.一般思路 二.具体问题 1.网络问题 (1)网络不通 (2)网络很慢 2.硬件问题 3.操作系统问题 (1)系统无法正常启动 (2)系统运行慢或死机 4.服务或程序问题 ...

  6. 关于C# winform怎么调用webapi来获取到json数据

    C/S系统也可以和B/S系统一样实现“前后端分离”,那这样写winform就相当于纯粹的前端页面了,然后再单独部署一个webapi项目,通过api调用数据库进行数据的操作,有利于维护和数据安全性的提高 ...

  7. c/c++编译和链接过程

    编译器把一个cpp编译为目标文件的时候,除了要在目标文件里写入cpp里包含的数据和代码,还要至少提供3个表:未解决符号表,导出符号表和地址重定向表. 未解决符号表提供了所有在该编译单元里引用但是定义并 ...

  8. Hi3518EV200音频相关

    1.sample程序可以录音,音频格式为G711A.G711U.G726.ADPCM: 2.ADPCM找不到音频播放器 3.G711格式海思添加了4字节头0x00 0x01 0x0a 0x00,普通播 ...

  9. day6大纲

    01 昨日内容回顾 字典: 增: setdefault() 有责不变,无责添加 dic['key'] = value 删: pop 按照key pop('key') pop('key',None) p ...

  10. 代码风格统一工具:EditorConfig 和 静态代码检查工具:ESLint

    EditorConfig 最常见的用途是:统一文件的编码字符集以及缩进风格 使用 Eslint 做代码 lint,那么为什么还要使用 .editorconfig 呢?细细想了下,应该有两个方面吧. E ...