热门文章 | 热门软件| 热门源码 | 热门电影 | 知识库 | 联系我们
软件 源码 教程 影视 健康 招聘
  HTML | JavaScript | ASP | PHP | JSP | NET | VB | VC | VF | Windows | Linux | Mysql | Mssql | Oracle | Struts 
当前位置: 创世纪计算机资源网 -> 文章频道 ->linux 
站内搜索:
常用Linux与Windows共享 建最简Samba(5)
作者:北南南北 来源:LinuxSir.Org 整理日期:2006-8-5

当然们还得学会查看用户信息的工具用法,比如 用finger和id来查看用户信息,主要是看用户是否添加正确;比如;请参考《Linux 用户(User)查询篇》

[root@localhost ~]# id linuxsir

[root@localhost ~]# finger linuxsir

5.3.3 添加samba用户,并设置密码;

们用的方法是先添加用户,但添加的这些用户都是虚拟用户,因为这些用户是不能通过SHELL登录系统的;另外值得注意的是系统用户密码和Samba用户的密码是不同的。如果您设置了系统用户能登入SHELL,可以设置用户的Samba密码和系统用户通过SHELL登录的密码不同。

们通过smbpasswd 来添加Samba用户,并设置密码。原理是通过读取/etc/passwd文件中存在的用户名。

[root@localhost sir01]# smbpasswd -a linuxsir

New SMB password: 注:在这里添加Samba用户linuxsir的密码;

Retype new SMB password: 注:再输入一次;

用同样的方法来添加 sir01、sir02、sir03、sir04的密码;

5.3.4 配置相关目录的权限和归属;

[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 sir01.linuxsir sir01

[root@cuc03 ~]# chown sir02.linuxsir sir02

[root@cuc03 ~]# chown sir03.linuxsir sir03

[root@cuc03 ~]# chown sir04.linuxsir sir04

[root@cuc03 ~]# chown linuxsir.sir0104 sir0104rw

[root@cuc03 ~]# chown linuxsir.linuxsir sirshare

[root@cuc03 ~]# chmod 755 sirshare

[root@cuc03 ~]# chown linuxsir:linuxsir sirallrw

[root@cuc03 ~]# chmod 3777 sirallrw

5.4 修改Samba配置文件 smb.conf;

配置文件如下,修改/etc/samba/smb.conf后,不要忘记重启smbd和nmbd服务器;

[global]

workgroup = LINUXSIR

netbios name = LinuxSir

server string = Linux Samba Test Server

security = share

[linuxsir]

comment = linuxsiradmin

path = /opt/linuxsir/

create mask = 0664

#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 = 0664

directory mask = 0775

writeable = yes

valid users = linuxsir,@sir0104

[1]  [2]  [3]  [4]  [5]  [6]  
相关文章
暂无