samba,用於網路文件共用,類似於nfs,samba多用於win和linux之間linux之間多用nfsc/s架構smb協議samba主要是兩個服務,核心啟動服務SMB,監聽139TCP埠,NMB服務類似DSN功能,如果不啟,只能以ip來訪問,監聽137 138UDP埠使用yum -y ins... ...
samba,用於網路文件共用,類似於nfs,
samba多用於win和linux之間
linux之間多用nfs
c/s架構
smb協議
samba主要是兩個服務,核心啟動服務SMB,監聽139TCP埠,NMB服務類似DSN功能,如果不啟,只能以ip來訪問,監聽137 138UDP埠
使用
yum -y install samba
然後防火牆
systemctl stop firewalld.service
然後selinux
[root@localhost ~]# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: enforcing Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Max kernel policy version: 31 [root@localhost ~]# setenforce 0 [root@localhost ~]# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Max kernel policy version: 31 [root@localhost ~]#
啟動下smb
[root@localhost ~]# service smb status Redirecting to /bin/systemctl status smb.service ● smb.service - Samba SMB Daemon Loaded: loaded (/usr/lib/systemd/system/smb.service; disabled; vendor preset: disabled) Active: inactive (dead) Docs: man:smbd(8) man:samba(7) man:smb.conf(5) [root@localhost ~]# systemctl start smb [root@localhost ~]# service smb status Redirecting to /bin/systemctl status smb.service ● smb.service - Samba SMB Daemon Loaded: loaded (/usr/lib/systemd/system/smb.service; disabled; vendor preset: disabled) Active: active (running) since Mon 2019-04-01 15:34:00 CST; 5s ago Docs: man:smbd(8) man:samba(7) man:smb.conf(5) Main PID: 3137 (smbd) Status: "smbd: ready to serve connections..." Tasks: 4 CGroup: /system.slice/smb.service ├─3137 /usr/sbin/smbd --foreground --no-process-group ├─3140 /usr/sbin/smbd --foreground --no-process-group ├─3141 /usr/sbin/smbd --foreground --no-process-group └─3142 /usr/sbin/smbd --foreground --no-process-group Apr 01 15:34:00 localhost.localdomain systemd[1]: Starting Samba SMB Daemon... Apr 01 15:34:00 localhost.localdomain smbd[3137]: [2019/04/01 15:34:00.812166, 0] ../lib/util/become_daemon.c:138(daemon_ready) Apr 01 15:34:00 localhost.localdomain smbd[3137]: daemon_ready: STATUS=daemon 'smbd' finished starting up and ready to serve connections Apr 01 15:34:00 localhost.localdomain systemd[1]: Started Samba SMB Daemon. [root@localhost ~]#
配置文件/etc/samba/smb.conf,就預設配置吧 然後添加用戶
[root@localhost samba]# pdbedit -a oracle new password: retype new password: Unix username: oracle NT username: Account Flags: [U ] User SID: S-1-5-21-3894974451-2409427747-3149240937-1000 Primary Group SID: S-1-5-21-3894974451-2409427747-3149240937-513 Full Name: Home Directory: \\localhost\oracle HomeDir Drive: Logon Script: Profile Path: \\localhost\oracle\profile Domain: LOCALHOST Account desc: Workstations: Munged dial: Logon time: 0 Logoff time: Wed, 06 Feb 2036 23:06:39 CST Kickoff time: Wed, 06 Feb 2036 23:06:39 CST Password last set: Mon, 01 Apr 2019 15:49:50 CST Password can change: Mon, 01 Apr 2019 15:49:50 CST Password must change: never Last bad password : 0 Bad password count : 0 Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [root@localhost samba]# pdbedit -L oracle:54321: [root@localhost samba]#
win中入網賬號密碼就可以了