码迷,mamicode.com
首页 > 其他好文 > 详细

samba

时间:2020-01-11 00:03:24      阅读:84      评论:0      收藏:0      [点我收藏+]

标签:red   comment   客户端   sha   sysconfig   back   服务端   sam   global   

服务端:

[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

标签:red   comment   客户端   sha   sysconfig   back   服务端   sam   global   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!