标签:
# yum install samba samba-client -y
# systemctl enable smb.service ln -s ‘/usr/lib/systemd/system/smb.service‘ ‘/etc/systemd/system/multi-user.target.wants/smb.service‘
3、查看是否设置成功
# systemctl status smb.service smb.service - Samba SMB Daemon Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled) Active: inactive (dead)
# systemctl start smb.service
# systemctl status smb.service smb.service - Samba SMB Daemon Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled) Active: active (running) since Sat 2014-12-27 00:15:48 EST; 11s ago Main PID: 2372 (smbd) Status: "smbd: ready to serve connections..." CGroup: /system.slice/smb.service ├─2372 /usr/sbin/smbd └─2373 /usr/sbin/smbd Dec 27 00:15:48 localhost.localdomain smbd[2372]: [2014/12/27 00:15:48.521059, 0] ../lib/util/become...dy) Dec 27 00:15:48 localhost.localdomain systemd[1]: Started Samba SMB Daemon. Dec 27 00:15:48 localhost.localdomain smbd[2373]: STATUS=daemon ‘smbd‘ finished starting up and ready...FUL Hint: Some lines were ellipsized, use -l to show in full.
# cd /etc/samba
备份:
# cp smb.conf smb.conf.bak
修改smb.conf文件,找到“[homes]”,修改以下设置:
[homes] comment = Home Directories browseable = no writable = yes valid users = %S valid users = MYDOMAIN\%S create mask = 0664 force create mode = 0664 directory mask = 0775 force directory mode = 0775 =====================================================
create mask = 0664 force create mode = 0664 directory mask = 0775 force directory mode = 0775
# smbpasswd -a username
如果出现bash: smbpasswd: command not found,就是没有安装samba-client了
# getsebool -a | grep samba
# setsebool -P samba_enable_home_dirs on
# firewall-cmd --list-services # firewall-cmd --permanent --add-service=samba # firewall-cmd --reload # firewall-cmd --list-services
由于redhat7开始,iptables被firewalld代替了,所以使用firewalld的方法
10、重启samba服务
标签:
原文地址:http://www.cnblogs.com/zakun/p/5971641.html