flyonok

统计

留言簿(7)

ACE

book

boost

bsd

c study

c++

code download

codeblock

computer clound

Eclipse

embed system

erlang

ET++

gtk

ic card

java

KDE

libevent

linux

linux--MM

mysql

network education

one card

oracle

pcap relation

php

powerbuilder

python

QT

software config

software test

SQL server

UML

wireless

wxwidgets

陈宾

阅读排行榜

评论排行榜

在ubuntu上安装和配置samba

1、安装samba
sudo apt-get install samba
2、配置samba
sudo /etc/init.d/samba stop
备份原有的配置文件
sudo mv /etc/samba/smb.conf /etc/samba/samba/smb.conf.template
创建空配置文件
sudo touch /etc/samba/smb.conf

配置
sudo nano /etc/samba/smb.conf
把以下内容拷贝过去

[global]
    ; General server settings
    netbios name 
= YOUR_HOSTNAME
    server 
string =
    workgroup 
= YOUR_WORKGROUP
    announce version 
= 5.0
    socket options 
= TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

    passdb backend 
= tdbsam
    security 
= user
    
null passwords = true
    username map 
= /etc/samba/smbusers
    name resolve order 
= hosts wins bcast

    wins support 
= yes

    printing 
= CUPS
    printcap name 
= CUPS

    syslog 
= 1
    syslog only 
= yes

; NOTE: 
If you need access to the user home directories uncomment the
; lines below 
and adjust the settings to your hearts content.
;[homes]
    ;valid users 
= %S
    ;create mode 
= 0600
    ;directory mode 
= 0755
    ;browseable 
= no
    ;read only 
= no
    ;veto files 
= /*.{*}/.*/mail/bin/

; NOTE: Only needed 
if you run samba as a primary domain controller.
Not needed as this config doesn't cover that matter.
;[netlogon]
    ;path 
= /var/lib/samba/netlogon
    ;admin users 
= Administrator
    ;valid users 
= %U
    ;read only 
= no

; NOTE: Again 
- only needed if you're running a primary domain controller.
;[Profiles]
    ;path 
= /var/lib/samba/profiles
    ;valid users 
= %U
    ;create mode 
= 0600
    ;directory mode 
= 0700
    ;writeable 
= yes
    ;browseable 
= no

; NOTE: Inside this place you may build a printer driver repository 
for
; Windows 
- I'll cover this topic in another HOWTO.
[print$]
    path 
= /var/lib/samba/printers
    browseable 
= yes
    guest ok 
= yes
    read only 
= yes
    write list 
= root
    create mask 
= 0664
    directory mask 
= 0775

[printers]
    path 
= /tmp
    printable 
= yes
    guest ok 
= yes
    browseable 
= no

; Uncomment 
if you need to share your CD-/DVD-ROM Drive
;[DVD
-ROM Drive]
    ;path 
= /media/cdrom
    ;browseable 
= yes
    ;read only 
= yes
    ;guest ok 
= yes

[MyFiles]
    path 
= /media/samba/
    browseable 
= yes
    read only 
= no
    guest ok 
= no
    create mask 
= 0644
    directory mask 
= 0755
    force user 
= YOUR_USERNAME
    force group 
= YOUR_USERGROUPOk, I already mentioned that there are a few

然后进行以下修改
YOUR_HOSTNAME--〉你的linux机器名
YOUR_WORKGROUP
--〉和你的windows的workgroup一样
[MyFiles]
path 
= /media/samba/--〉你需要和windows系统共享的linux文件目录
这个目录一定要存在
比如
/home/xiaowy/share
-> force user = YOUR_USERNAME
-> force group = YOUR_USERNAME
比如sambashare

YOUR_USERNAME
--〉共享访问的用户名
在linux和windows上都要有,且密码也是一样的

3、改变目录权限
sudo chmod 0777 /home/xiaowy/share

4、增加用户
sudo useradd -/bin/true sambashare
sudo smbpasswd 
--a sambashare
sudo smbpasswd 
--e sambashare
这个时候会提示你输入密码
记得和windows下的一样!
5、在windows里的网络设置里启动netbios on tcp/ip

6、访问
在运行中输入\\你的linux机器的ip地址
提示你输入用户名和密码,就是刚才第4步的信息,就可以访问了

posted on 2007-12-24 12:54 flyonok 阅读(377) 评论(0)  编辑 收藏 引用 所属分类: linux


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理