centos安装samba

--centos安装samba
yum -y install samba samba-common samba-client

--创建用户
groupadd smb
useradd -g smb smbuser
pdbedit -a -u smbuser

--创建目录
mkdir /home/smbuser/smb
chmod 777 /home/smbuser/smb

--配置共享
vi /etc/samba/smb.conf

配置节
[smb]
        comment = user public directory
        path=/home/smbuser/smb
        browseable = yes
        writable = yes
        write list = smbuser

--关闭SELinux
vi /etc/selinux/config
配置节
SELINUX=disabled

--重启,配置生效
service smb restart
service nmb restart 

--开机启动
systemctl enable smb
systemctl enable nmb

--Windows挂载(电脑->映射网络驱动器)
\\192.168.10.201\smb

--centos 挂载
yum -y install cifs-utils
mkdir /smb201
--临时挂载,重启后消失
mount -t cifs -o username=smbuser,password=123456, //192.168.10.201/smb/ /smb201
--开机挂载
chmod +x /etc/rc.local
chmod +x /etc/rc.d/rc.local
vi /etc/rc.local
#mount -t cifs -o username=smbuser,password=123456, //192.168.10.201/smb/ /smb201
#exit 0

 

posted on 2019-08-19 17:13  陈银鑫  阅读(2824)  评论(0编辑  收藏  举报