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