Samba可以使我们在Linux和Windows计算机间分享文件。在目前的版本(v3),不仅可存取及分享SMB的资料夹及印表机,本身还可以整合到Windows Server的网域、扮演为网域控制站(Domain Controller)以及加入Active Directory成员。简而言之,可用该应用在Windows与UNIX系列OS之间搭起一座桥梁,让两者的资源可互通有无。下面为大家介绍如何在Debian Squeeze下安装配置SAMBA。#1
假定服务器IP为:192.168.58.142#2安装Samba
打开终端,输入命令,安装Samba及相关依赖:sudo apt-get install libcupsys2 samba samba-common你会遇到下面的问题:Workgroup/Domain Name: 这里我们填写一个工作组的名字即可。编辑smb.conf文件,使用命令:vi /etc/samba/smb.conf下面激活行“security = user”,让Linux操作系统可以[...]
# “security = user” is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
security = user
[...]
保存文件,退出,重启Samba/etc/init.d/samba restart#3 添加Samba分享
创建文件分享目录,向用户组开放:mkdir -p /home/samba-share/allusers
chown -R root:users /home/samba-share/allusers/
chmod -R ug+rwx,o+rx-w /home/samba-share/allusers/在文件 /etc/samba/smb.conf添加下面行,
首先,使用命令,打开:vi /etc/samba/smb.conf接下来,添加下面内容:[allusers]
comment = All Users
path = /home/samba-share/allusers
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
writable = yes如果你希望所有的用户可以通过Samba服务器来读、写他们的主目录,可以在文件 /etc/samba/smb.conf 添加下面的内容:[...]
[homes]
comment = Home Directories
browseable = no
valid users = @users
writable = yes
create mask = 0700
directory mask = 0700然后保存,重启Samba服务器:/etc/init.d/samba restart不要忘记设置配置文件为只读:{这个地方有点不懂,原文讲的是“Dont forget to set read only to noin the config file”}# By default, the home directories are exported read-only. Change the
# next parameter to ‘no’ if you want to be able to write to them.
read only = no#4 添加、管理用户
比如,添加用户Bentutu,命令如下:useradd Bentutu -m -G users为Bentutu设置密码:root@oss:~# passwd BentutuEnter new UNIX password:
Retype new UNIX password: 现在把Bentutu添加到Samba用户数据库:root@oss:~# smbpasswd -a Bentutu
Output
New SMB password:
Retype new SMB password:
Added user Bentutu.
root@oss6:~# 现在,就可以从文件管理器登录了,别忘了地址{地址是\192.168.58.142或者\192.168.58.142Bentutu},其中Bentutu为你设置的用户名。 一次Linux系统内核升级记录Linux下从视频提取音频的方法相关资讯 samba Debian
- Debian GNU/Linux系统迎来23岁生日 (08月18日)
- 给Samba添加回收站功能 (06月18日)
- Debian Live 项目的剧变 (05月04日)
| - CentOS部署Samba企业文件共享服务 (06月23日)
- Debian停止支持一批旧的32位CPU (05月09日)
- Linux桌面发行版Debian安装起来到 (05月04日)
|
本文评论 查看全部评论 (0)