02-SAMBA文件共享服务

SAMBA

作用:windows和类unix系统文件共享服务


服务端linux


软件 samba samba-common
service nmb smb
daemon nmbd smbd
端口 137 138|139 445
配置文件 /etc/samba/smb.conf
数据文件 /var/lib/samba
日志文件 /var/log/samba

===========================================

客户端linux

软件 samba-client
命令 smbclient
smbclient -L ip -U username
smbpasswd -a username
smbpasswd username
smbclient //172.25.0.11/共享名
smbclient //172.25.0.11/共享名 -U student
mount -t cifs //172.25.15.11/共享名 /mnt guest
mount -t cifs //172.25.15.11/共享名 /mnt -o username=student

详细步骤

系统用户
服务器端rhel6
###########
[root@rhel6 ~]# yum install -y samba samba-common
[root@rhel6 ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[root@rhel6 ~]#
[root@rhel6 ~]# service smb start
Starting SMB services: [ OK ]
[root@rhel6 ~]# service nmb start
Starting NMB services: [ OK ]
[root@rhel6 ~]# id student
uid=500(student) gid=500(student) groups=500(student)
[root@rhel6 ~]# which smbpasswd
/usr/bin/smbpasswd
[root@rhel6 ~]# smbpasswd -a student
New SMB password:
Retype new SMB password:
Added user student.
[root@rhel6 ~]# getsebool -a|grep samba
samba_create_home_dirs –> off
samba_domain_controller –> off
samba_enable_home_dirs –> off
samba_export_all_ro –> off
samba_export_all_rw –> off
samba_portmapper –> off
samba_run_unconfined –> off
samba_share_fusefs –> off
samba_share_nfs –> off
sanlock_use_samba –> off
use_samba_home_dirs –> off
virt_use_samba –> off
[root@rhel6 ~]# setsebool -P samba_enable_home_dirs 1
[root@rhel6 ~]# getsebool -a|grep samba
samba_create_home_dirs –> off
samba_domain_controller –> off
samba_enable_home_dirs –> on
samba_export_all_ro –> off
samba_export_all_rw –> off
samba_portmapper –> off
samba_run_unconfined –> off
samba_share_fusefs –> off
samba_share_nfs –> off
sanlock_use_samba –> off
use_samba_home_dirs –> off
virt_use_samba –> off

客户端linux——类似ftp的方式访问

[root@rhel7 ~]# systemctl stop firewalld
[root@rhel7 ~]# yum install -y samba-client
[root@rhel7 ~]# smbclient -L 172.25.0.11
Ent

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值