首页 > 其他 > 详细

samba

时间:2020-01-10 23:48:51      阅读:88      评论:0      收藏:0      [点我收藏+]

服务端:

[root@linuxprobe ~]# yum install samba -y

[root@linuxprobe ~]# mv /etc/samba/smb.conf /etc/samba/smb.bak

[root@linuxprobe ~]# cat /etc/samba/smb.bak | grep -v "#" | grep -v ";" | grep -v "^$" > /etc/samba/smb.conf

[root@linuxprobe ~]# vim /etc/samba/smb.conf

[global]

        workgroup = MYGROUP

        server string = Samba Server Version %v

        log file = /var/log/samba/log.%m

        max log size = 50

        security = user

        passdb backend = tdbsam

[rick]

        comment = ding

        path = /rick

        public = no

        writable = yes

 

[root@linuxprobe ~]# systemctl restart smb

[root@linuxprobe ~]# systemctl enable smb

ln -s ‘/usr/lib/systemd/system/smb.service‘ ‘/etc/systemd/system/multi-user.target.wants/smb.service‘

 

[root@linuxprobe ~]# id linuxprobe

uid=1000(linuxprobe) gid=1000(linuxprobe) groups=1000(linuxprobe)

[root@linuxprobe ~]# pdbedit -a -u linuxprobe

new password:

retype new password:

Unix username:        linuxprobe

 

[root@linuxprobe ~]# mkdir -p /rick

[root@linuxprobe ~]# chown -Rf linuxprobe:linuxprobe /rick

[root@linuxprobe ~]# chmod -Rf 777 /rick

[root@linuxprobe ~]# getsebool -a | grep samba

samba_create_home_dirs --> off

samba_domain_controller --> off

samba_enable_home_dirs --> off

samba_export_all_ro --> off

samba_export_all_rw --> off

samba_portmapper --> off

samba_run_unconfined --> off

samba_share_fusefs --> off

samba_share_nfs --> off

sanlock_use_samba --> off

use_samba_home_dirs --> off

virt_sandbox_use_samba --> off

virt_use_samba --> off

[root@linuxprobe ~]# setsebool -P samba_export_all_rw=on

[root@linuxprobe ~]# iptables -F

[root@linuxprobe ~]# service iptables  save

iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]

客户端:

[root@localhost ~]# yum install cifs-utils -y

[root@localhost ~]# vim auth.smb

username=linuxprobe

password=ding

domain=MYGROUP

[root@localhost ~]# vim /etc/fstab

[root@localhost ~]# mkdir /rick

[root@localhost ~]# vim /etc/fstab

//192.168.10.10/rick /rick cifs credentials=/root/auth.smb 0 0

[root@localhost ~]# mount -a

[root@localhost ~]# df -h

//192.168.10.10/rick    18G  3.0G   15G  17% /rick

 

samba

原文:https://www.cnblogs.com/dinghailong128/p/12178414.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!