[root@huangjun Server]# rpm -ivh samba-3.0.33-3.14.el5.x86_64.rpm
warning: samba-3.0.33-3.14.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:samba ########################################### [100%]
[root@huangjun Server]# rpm -ivh samba-client-3.0.33-3.14.el5.x86_64.rpm
warning: samba-client-3.0.33-3.14.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
package samba-client-3.0.33-3.14.el5.x86_64 is already installed
[root@huangjun Server]# rpm -ivh samba-common-3.0.33-3.14.el5.
error: open of samba-common-3.0.33-3.14.el5. failed: No such file or directory
[root@huangjun Server]# rpmgetconf LONG_BIT
-bash: rpmgetconf: command not found
[root@huangjun Server]# getconf LONG_BIT
64
[root@huangjun Server]# rpm -ivh samba-common-3.0.33-3.14.el5.x86_64.rpm
warning: samba-common-3.0.33-3.14.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
package samba-common-3.0.33-3.14.el5.x86_64 is already installed
[root@huangjun Server]# rpm -ivh samba-swat-3.0.33-3.14.el5.x86_64.rpm
warning: samba-swat-3.0.33-3.14.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:samba-swat ########################################### [100%]
[root@huangjun Server]# servicesmb status
smbd is stopped
nmbd is stopped
[root@huangjun 123]# cp -p /etc/samba/smb.conf /home/huangjun/123/smb.conf.bk
[root@huangjun 123]# echo "" > /etc/samba/smb.conf
[root@huangjun 123]# vi /etc/samba/smb.conf
加入以下。。。。。。。。。。。。。。。。。。
[global]
workgroup = workgroup
netbios name = centos
server string = Samba Server
# printcap name = /etc/printcap
printable = no
load printers = no
cups options = raw
log file = /var/log/samba/%m.log
max log size = 50
[detail]
comment =detail
browseable = yes
path =/data/detail
create mask =0664 #是用户创建文件时的权限掩码;对用户来可读可写,对用户组可读可写,对其它用户可读;
directory mask =0775 #是用来设置用户创建目录时的权限掩码,意思是对于用户和用户组可读可写,对其它用户可读可执行;
valid users = uploaduser,@rwgroup,@readgroup,readuser
public = no
writable = yes
#write list = @staff
#hosts allow=192.168.1.200 192.168.1.221 192.168.1.234 192.168.1.247 192.168.1.249 192.168.1.197
[detail99114]
comment =detail99114
browseable = yes
path =/data/detail99114
create mask =0664 #是用户创建文件时的权限掩码;对用户来可读可写,对用户组可读可写,对其它用户可读;
directory mask =0775 #是用来设置用户创建目录时的权限掩码,意思是对于用户和用户组可读可写,对其它用户可读可执行;
valid users = rwuser,@rwgroup,@readgroup,readuser
public = no
writable = yes
[root@huangjun 123]# groupaddsambarw
[root@huangjun 150]# idhuangjun
uid=502(huangjun) gid=502(huangjun) groups=502(huangjun) context=user_u:system_r:unconfined_t
[root@huangjun 150]#usermod -g huangjun -G sambarwhuangjun
[root@huangjun 150]# idhuangjun
uid=502(huangjun) gid=502(huangjun) groups=502(huangjun),505(sambarw) context=user_u:system_r:unconfined_t
chownhuangjun:root 150/
[root@huangjun /]# ll
total 162
drwxr-xr-x 3huangjun root 4096 Oct 24 02:48 150
[root@huangjun /]# servicesmb restart
Shutting down SMB services: [FAILED]
Shutting down NMB services: [FAILED]
Starting SMB services: [ OK ]
Starting NMB services: [ OK ]
Smbpasswd–a huangjun
Servieriptables stop
A 不需要重启Linux:
[root@localhost ~]# setenforce 0
B 需要重启Linux:
vi /etc/selinux/config将SELINUX=enforcing 改成SELINUX=disabled
一、关闭SELINUX
vi /etc/selinux/config
#SELINUX=enforcing #注释掉
#SELINUXTYPE=targeted #注释掉
SELINUX=disabled #增加
:wq保存,关闭
shutdown -r now #重启系统
-------------
setenforce 0临时
vi /etc/sysconfig/selinux
vi /etc/selinux/config
测试
转载于:https://blog.51cto.com/whiptiger/1122233