linux下samba服务器share的共享

[root@localhost root]# rpm -qa|grep samba
//查看samba是否的安装
samba-2.2.7a-7.9.0
redhat-config-samba-1.0.4-1
samba-common-2.2.7a-7.9.0
samba-client-2.2.7a-7.9.0
[root@localhost root]# service smb start
//启动samba服务
启动 SMB 服务:                                            [  确定  ]
启动 NMB 服务:                                            [  确定  ]
[root@localhost root]# pgrep smbd
//查看smb服务器是否运行
2709
[root@localhost root]# pgrep nmbd
//查看nmb是否运行,如果没有运行,查看ip,子网掩码是否配置
[root@localhost root]# ifconfig
//没有配置linux的ip,子网掩码,接下来配置ip,子网掩码。ip与windows xp时同一网段的,子网掩码相同
eth0      Link encap:Ethernet  HWaddr 00:0C:29:64:79:7C
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:93 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:9592 (9.3 Kb)  TX bytes:5472 (5.3 Kb)
          Interrupt:10 Base address:0x2024

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:7505 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7505 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:512783 (500.7 Kb)  TX bytes:512783 (500.7 Kb)
[root@localhost root]# ifconfig eth0 172.19.23.11 netmask 255.255.254.0
[root@localhost root]#ping -c 4 172.19.23.21
//ping一下windows xp的ip地址看是否能ping通,ping通说明网络联通
PING 172.19.23.21 (172.19.23.21) 56(84) bytes of data.
64 bytes from 172.19.23.21: icmp_seq=1 ttl=64 time=0.823 ms
64 bytes from 172.19.23.21: icmp_seq=2 ttl=64 time=0.161 ms
64 bytes from 172.19.23.21: icmp_seq=3 ttl=64 time=0.137 ms
64 bytes from 172.19.23.21: icmp_seq=4 ttl=64 time=0.111 ms

--- 172.19.23.21 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 0.111/0.308/0.823/0.297 ms
[root@localhost root]# netstat -tlnp|grep smb
//查看smb所占用的端口,smb端口为139
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN
2709/smbd
[root@localhost root]# iptables -F
//清除防火墙规则
[root@localhost root]# cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
//备份samba的配置文件,以防万一
[root@localhost root]# vi /etc/samba/smb.conf
//编辑smb文件找到security=user,将其给为security=share
按ESC
:wq
保存退出

[root@localhost root]# service smb restart
//重启samba服务器,使配置文件生效
关闭 SMB 服务:                                            [  确定  ]
关闭 NMB 服务:                                            [  确定  ]
启动 SMB 服务:                                            [  确定  ]
启动 NMB 服务:                                            [  确定  ]
[root@localhost root]# mkdir /mnt/text
//在/mnt目录下建一个子目录text
[root@localhost root]# chmod 0777 /mnt/text
//给子文件text,用户、组、其他用户执行、读写的权限
[root@localhost root]# vi + /etc/samba/smb.conf
//编辑smb.conf配置文件,光标处在文件的末尾,添加系列内容
#This is samba text  // 注释说明
[text]              //共享目录的名字
comment=text   
path=/mnt/text     //共享目录路径
read only=no        //指定目录是否可读
writable=yes      //指定目录是否可行
public=yes         //指定目录是否可以guest访问
//按ESC
:wq
//保存退出
[root @localhost root]#service smb restart
//重启samba服务
关闭 SMB 服务:                                            [  确定  ]
关闭 NMB 服务:                                            [  确定  ]
启动 SMB 服务:                                            [  确定  ]
启动 NMB 服务:                                            [  确定  ]
//最后在windows xp的IE地址栏输入:samba的服务器的地址,就会访问到text共享文件夹

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值