rpm -ivh samba-3033-339el5_8i386rpm --nodeps
rpm -ivh samba-client-3033-339el5_8i386rpm --nodeps
rpm -ivh samba-common-3033-339el5_8i386rpm --nodeps
rpm -qa | grep samba
samba-3033-339el5_8
samba-client-3033-339el5_8
samba-common-3033-339el5_8
cd /etc/samba/
mv smbconf smbconfbak
touch sbmconf
vi smbconf
workgroup = LinuxSir
netbios name = LinuxSir05
server string = Linux Samba Server TestServer
security = share
[linuxsir]
path = /opt/linuxsir
writeable = yes
browseable = yes
guest ok = yes
mkdir -p /opt/linuxsir
id nobody
chown -R nobody:nobody /opt/linuxsir
[root@localhost samba]# smbd
[root@localhost samba]# nmbd
done
52 在服务器上创建相应的目录;
[root@localhost ~]# mkdir -p /opt/linuxsir
[root@localhost ~]# cd /opt/linuxsir
[root@localhost linuxsir]# mkdir sir01 sir02 sir03 sir04 sirshare sir0104rw sirallrw
[root@localhost linuxsir]# ls
sir01 sir0104rw sir02 sir03 sir04 sirallrw sirshare
531 添加用户组;
[root@localhost ~]# /usr/sbin/groupadd linuxsir
[root@localhost ~]# /usr/sbin/groupadd sir01
[root@localhost ~]# /usr/sbin/groupadd sir02
[root@localhost ~]# /usr/sbin/groupadd sir03
[root@localhost ~]# /usr/sbin/groupadd sir04
[root@localhost ~]# /usr/sbin/groupadd sir0104
532 添加用户;
[root@cuc03 ~]# adduser -g sir01 -G sir0104 -d /opt/linuxsir/sir01 -s /sbin/nologin sir01
[root@cuc03 ~]# adduser -g sir02 -G sir0104 -d /opt/linuxsir/sir02 -s /sbin/nologin sir02
[root@cuc03 ~]# adduser -g sir03 -G sir0104 -d /opt/linuxsir/sir03 -s /sbin/nologin sir03
[root@cuc03 ~]# adduser -g sir04 -G sir0104 -d /opt/linuxsir/sir04 -s /sbin/nologin sir04
[root@cuc03 ~]# adduser -g linuxsir -d /opt/linuxsir -G
linuxsir,sir01,sir02,sir03,sir04,sir0104 -d /opt/linuxsir -s
/sbin/nologin linuxsir
[root@localhost ~]# id linuxsir
[root@localhost ~]# finger linuxsir
[root@localhost sir01]# smbpasswd -a linuxsir
New SMB password: 注:在这里添加Samba用户linuxsir的密码;
Retype new SMB password: 注:再输入一次;
用同样的方法来添加 sir01、sir02、sir03、sir04的密码;
[root@cuc03 ~]# chmod 755 /opt/linux
[root@cuc03 ~]# chown linuxsir:linuxsir /opt/linuxsir
[root@cuc03 ~]# cd /opt/linuxsir
[root@cuc03 ~]# chmod 2770 sir0*
[root@cuc03 ~]# chown sir01linuxsir sir01
[root@cuc03 ~]# chown sir02linuxsir sir02
[root@cuc03 ~]# chown sir03linuxsir sir03
[root@cuc03 ~]# chown sir04linuxsir sir04
[root@cuc03 ~]# chown linuxsirsir0104 sir0104rw
[root@cuc03 ~]# chown linuxsirlinuxsir sirshare
[root@cuc03 ~]# chmod 755 sirshare
[root@cuc03 ~]# chown linuxsir:linuxsir sirallrw
[root@cuc03 ~]# chmod 3777 sirallrw
54 修改Samba配置文件 smbconf;
配置文件如下,修改/etc/samba/smbconf后,不要忘记重启smbd和nmbd服务器;
[global]
workgroup = LINUXSIR
netbios name = LinuxSir
server string = Linux Samba TestServer
security = share
[linuxsir]
comment = linuxsiradmin
path = /opt/linuxsir/
create mask = 775
#create mask是用户创建文件时的权限掩码;
directory mask = 0775
#directory mask 是用来设置用户创建目录时的权限掩码,意思是对于用户和用户组可读可写,对其它用户可读可执行;
writeable = yes
valid users = linuxsir
browseable = yes
[sirshare]
path = /opt/linuxsir/sirshare
writeable = yes
browseable = yes
guest ok = yes
[sirallrw]
path = /opt/linuxsir/sirallrw
writeable = yes
browseable = yes
guest ok = yes
[sir0104rw]
comment = sir0104rw
path = /opt/linuxsir/sir0104rw
create mask = 775
directory mask = 0775
writeable = yes
valid users = linuxsir,@sir0104
#@sir0104是用户组;
browseable = yes
[sir01]
comment = sir01
path = /opt/linuxsir/sir01
create mask = 775
directory mask = 0775
writeable = yes
valid users = sir01,@linuxsir
browseable = yes
[sir02]
comment = sir02
path = /opt/linuxsir/sir02
create mask = 775
directory mask = 0775
writeable = yes
valid users = sir02,@linuxsir
browseable = yes
[sir03]
comment = sir03
path = /opt/linuxsir/sir03
create mask = 775
directory mask = 0775
writeable = yes
valid users = sir03,@linuxsir
browseable = yes
[sir04]
comment = sir04
path = /opt/linuxsir/sir04
create mask = 775
directory mask = 0775
writeable = yes
valid users = sir04,@linuxsir
browseable = yes
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)