Centos6 Samba 3.6 Windows 10 1803 無法連線的問題 及Centos6升級 Samba4

一、Centos6升級 Samba4

CentOS Linux 6.10 samba 升级 Samba4

1.查看現行運作版本

 rpm -qa |grep samba

samba-winbind-3.6.23-53.el6_10.x86_64
samba-client-3.6.23-53.el6_10.x86_64
samba4-libs-4.2.10-15.el6.x86_64
samba-common-3.6.23-53.el6_10.x86_64
samba-3.6.23-53.el6_10.x86_64
samba-winbind-clients-3.6.23-53.el6_10.x86_64

2.備份現 samba 資料庫、設定檔和管理腳本

/etc/init.d/smb stop   ##先停止服務,再備份下面檔

smbd -b | grep DIR
 
PRIVATE_DIR: /var/lib/samba/private   ##samba資料庫路徑
/etc/samba/smb.conf    ##samba的設定檔路徑
/etc/init.d/smb   ##samba服務管理腳本

3.查看可更新的 samba 版本
3-1.安裝 EPEL 
3-2.yum info samba4

Loaded plugins: fastestmirror, priorities, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: ftp.tc.edu.tw
 * epel: fedora.cs.nctu.edu.tw
 * extras: ftp.tc.edu.tw
 * updates: ftp.tc.edu.tw
 * webtatic: us-east.repo.webtatic.com
2 packages excluded due to repository priority protections
Available Packages
Name        : samba4
Arch        : x86_64
Version     : 4.2.10
Release     : 15.el6
Size        : 428 k
Repo        : base
Summary     : Server and Client software to interoperate with Windows machines
URL         : http://www.samba.org/
License     : GPLv3+ and LGPLv3+
Description : Samba is the standard Windows interoperability suite of programs
            : for Linux and Unix.
3-3.移除samba3
for a in `rpm -qa|grep samba`; do rpm -e --nodeps $a;done

3-4.安裝samba4
yum -y install samba4 samba4-common samba4-client


4./etc/init.d/nmb start
/etc/init.d/smb start
chkconfig nmb on
chkconfig smb on

二、Centos6 Samba 3.6 Windows 10 1803 無法連線的問題

參考資料:https://eric0806.blogspot.com/2018/01/windows-10-samba-linux.html

1.PowerShell指令查 SMB版本

Get-SmbServerConfiguration

2.SMB1支援,安裝後重開機

3.利用底下指令來打開SMBv1

Set-SmbServerConfiguration -EnableSMB1Protocol $True