linux搭建samba服务器nokey,Linux下架设SAMBA服务器

实验环境:AS4最小化安装

实验目标:架设SAMBA服务器

编辑:crazylinux 2007.03.31

联系方式:http://crazylinux.cublog.cn

大家好!

这次我们来学习Linux系统中的 samba服务器的配置。

Samba服务器的IP是192.168.0.175

下面我们开始了!首先我们安装samba服务器端的软件

samba服务器的安装文件位于第2张安装光盘中

1,安装samba服务所需软件都在第2张光盘中

[root@localhost ~]# rpm -qa | grep samba

samba-common-3.0.10-1.4E

samba-client-3.0.10-1.4E

samba-3.0.10-1.4E

samba-swat-3.0.10-1.4E

system-config-samba-1.2.21-1

2,在samba服务器中为每个用户都配置独立的用户目录

在/etc/samba/smb.conf下有默认的

[homes]

comment = Home Directories

browseable = no

writable = yes

建立samba帐号前提要安装系统帐号(这2个帐号是一样的)

[root@localhost /]# useradd user1

[root@localhost /]# useradd user2

[root@localhost /]# passwd user1

[root@localhost /]# passwd user2

[root@localhost /]# smbpasswd -a user1建立samba帐号

New SMB password:

Retype new SMB password:

startsmbfilepwent_internal: file /etc/samba/smbpasswd did not exist. File successfully created.

Added user user1.

[root@localhost /]# cat /etc/samba/smbpasswd

user1:500:CCF9155E3E7DB453AAD3B435B51404EE:3DBDE697D71690A769204BEB12283678:[U]:LCT-45FCBEF7:

3,添加公共目录设置

在/etc/samba/smb.conf下面最后添加

[public]à共享目录名

path = /home/publicà公共共享目录的路径是“/home/public”

public = yesà对于所有Samba用户可见

only guest = yesà所有用户在使用该共享目录时的用户身份都是“guest”,即Linux系统用户“nobody”

writable = yesà该共享目录对于用户可写

4,对smb.conf测试

[root@localhost /]# testparm

5,启动samba服务

[root@localhost /]# service smb start

Starting SMB services: [OK]

Starting NMB services: [OK]

[root@localhost /]# service smb status

smbd(pid 2368 2364) is running...

nmbd(pid 2369) is running...

6,测试

A,在linux客户机中

显示指定Samba服务器中的共享资源列表

# smbclient -L 192.168.0.175

以指定用户身份登录到指定服务器的指定共享目录

# smbclient //192.168.0.175/public -U user1

“//192.168.0.175/public”表示服务器“192.168.1.2”中的共享目录“public”

“-U user1”表示以Samba用户“user1”的身份进行登录

#smbmount命令用于将Samba共享目录挂载到Linux文件系统中

# smbmount //192.168.0.175/public /mnt

B,在WIN中

7,在linux中访问win共享的文件

首先在WIN中设置好共享目录

[root@localhost ~]# smbclient //192.168.0.174/won -U feigewon是WIN共享目录feige是WIN的用户名

[root@localhost mnt]# mount -t smbfs -o username=feige //192.168.0.174/won /mnt

8,swat

在第4张光盘中,

[root@localhost/]# rpm -ivh /media/cdrom/RedHat/RPMS/samba-swat-3.0.10-1.4E.i386.rpm

warning: /media/cdrom/RedHat/RPMS/samba-swat-3.0.10-1.4E.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e

Preparing...########################################### [100%]

package samba-swat-3.0.10-1.4E is already installed

[root@localhost /]# chkconfig --list swat

swatoff

[root@localhost /]# chkconfig swat on开启swat服务

[root@localhost /]# service xinetd restart

Stopping xinetd: [OK]

Starting xinetd: [OK]

设置/etc/xinetd.d/swat把only_from改为192.168.0.174

[root@localhost /]# service xinetd restart

Stopping xinetd: [OK]

Starting xinetd: [OK]

输入root用户和密码就可以看到swat浏览页面

OK了吧 ,,,,

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值