免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3323 | 回复: 0
打印 上一主题 下一主题

在Solaris下配置SAMBA [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-12-14 22:57 |只看该作者 |倒序浏览
今天在公司看到有一台T5120闲置,于是用来做SAMBA配置测试。
环境配置:
用一根网线直连笔记本电脑的网口和T5120的e1000g0。IP的配置情况如下:
1.设置笔记本的本地连接IP/NETMASK:192.168.0.1/255.255.255.0,首选DNS服务器:192.168.0.1;如图1所示。

图1 本地IP配置
2.给e1000g0网口配置的IP/NETMASK/DEFULTROUTER:192.168.0.5/255.255.255.0/192.168.0.1。

详细配置步骤:
1.查看网络连接情况
[email=root@T5120]root@T5120[/email]
# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843 mtu 1500 index 2
        inet 192.168.0.5 netmask ffffff00 broadcast 192.168.0.255
        ether 0:21:28:24:7b:c8
[email=root@T5120]root@T5120[/email]
# ping 192.168.0.1
192.168.0.1 is alive
表示可以PING通笔记本。

图2 笔记本PING通主机T5120
图2表示在WINDOWS下可以PING通该主机。


2.查看samba服务的状态
root@T5120 # svcs -v |grep samba
[email=root@T5120]root@T5120[/email]
# ps -eaf |grep mbd
    root  1571  1405   0 16:38:44 console     0:00 grep mbd

3.配置smb.conf文件
[email=root@T5120][/email]
(1)配置用户验证方式
创建samba配置文件smb.conf。
[email=root@T5120]root@T5120[/email]
# cp /etc/sfw/smb.conf-example /etc/sfw/smb.conf
[email=root@T5120]root@T5120[/email]
# svcadm enable samba
root@T5120 # svcs |grep samba
online         16:56:07 svc:/network/samba:default
[email=root@T5120]root@T5120[/email]
# ps -eaf |grep smbd
    root  1629     1   0 16:56:07 ?           0:00 /usr/sfw/sbin/smbd -D
    root  1641  1405   0 16:57:27 console     0:00 grep smbd
    root  1630  1629   0 16:56:08 ?           0:00 /usr/sfw/sbin/smbd -D

创建系统用户allen并创建samba密码。
[email=root@T5120]root@T5120[/email]
# useradd -d /export/home/allen -m -s /usr/bin/bash allen
64 blocks
root@T5120 #
root@T5120 #
root@T5120 # /usr/sfw/bin/smbpasswd -a allen
New SMB password: xxxxxxx
Retype new SMB password: xxxxxxx
Added user allen.

重启samba服务。
[email=root@T5120]root@T5120[/email]
# svcadm restart samba
[email=root@T5120]root@T5120[/email]
# svcs |grep samba
online         17:20:05 svc:/network/samba:default
[email=root@T5120]root@T5120[/email]
# ps -eaf |grep mbd
    root  1618  1330   0 16:00:30 console     0:00 grep mbd
    root  1610     1   0 15:59:23 ?           0:00 /usr/sfw/sbin/smbd -D
    root  1611  1610   0 15:59:24 ?           0:00 /usr/sfw/sbin/smbd -D

4.在WINDOWS下测试samba共享文件
在windows下点击“开始”->“运行”,在打开输入框中输入
\\192.168.0.5
,如图3所示。

图3 在运行中输入samba的ip地址
按确定后要求输入用户名和密码,输入刚才配置的系统用户allen和smb的密码。如图4所示。

图4 输入用户以及该用户在samba的密码
可看到allen文件夹。如图5所示。

图5 allen文件夹
在WINDOWS的网上邻居中也可以看到该文件夹。如图6所示。

图6 samba网上邻居
可在该文件夹下做读写以及删除操作。如图7所示。

图7 可读写和删除allen文件夹下的内容
操作完毕后要右键刷新才能看到更改后的内容。

5.说明
可以通过编写samba配置文件/etc/sfw/smb.conf的相关选项来更改用户的访问权限以及各种操作权限等等。待续。


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/93557/showart_2121409.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP