CentOS 7.4 安裝配置Samba伺服器
[[email protected] ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
[[email protected] ~]# yum -y install samba samba-client
[[email protected] ~]# rpm -qi samba
Name : samba
Epoch : 0
Version : 4.6.2
Release : 12.el7_4
Architecture: x86_64
Install Date: Tue 06 Mar 2018 03:34:03 PM CST
Group : Unspecified
Size : 1932039
License : GPLv3+ and LGPLv3+
Signature : RSA/SHA256, Tue 28 Nov 2017 01:42:09 AM CST, Key ID 24c6a8a7f4a80eb5
Source RPM : samba-4.6.2-12.el7_4.src.rpm
Build Date : Tue 28 Nov 2017 12:25:36 AM CST
Build Host : c1bm.rdu2.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <
Vendor : CentOS
URL : http://www.samba.org/
Summary : Server and Client software to interoperate with Windows machines
Description :
Samba is the standard Windows interoperability suite of programs for Linux and Unix.
備份smb.conf
[[email protected] ~]# cd /etc/samba/
[
[[email protected] samba]# vi smb.conf
[[email protected] samba]# cat smb.conf
[global]
workgroup = WORKGROUP
server string = Ted Samba Server %v
netbios name = TedSamba
security = user
passdb backend = tdbsam
[SambaFileShare]
comment = share some files
path = /app/SambaFileShare
writable = yes
browseable = yes
write list = u_samba
create mask = 0644
directory mask = 0755
建立使用者
[[email protected] samba]# groupadd g_samba
[[email protected] samba]# useradd u_samba -g g_samba
[[email protected] samba]# smbpasswd -a u_samba
New SMB password:
Retype new SMB password:
Added user u_samba.
建立共享目錄
[[email protected] samba]# mkdir -p /app/SambaFileShare
[[email protected] samba]#
[[email protected] samba]# chown u_samba:g_samba /app/SambaFileShare
[[email protected] samba]# chmod 777 /app/SambaFileShare/
[[email protected] samba]# systemctl restart firewalld
[[email protected] samba]# firewall-cmd --permanent --add-port=139/tcp
FirewallD is not running
[[email protected] samba]# systemctl restart firewalld
[[email protected] samba]# firewall-cmd --permanent --add-port=139/tcp
Warning: ALREADY_ENABLED: 139:tcp
success
[[email protected] samba]# firewall-cmd --permanent --add-port=445/tcp
success
[[email protected] samba]# systemctl stop firewalld
[[email protected] samba]# systemctl status firewalld
關閉SELINUX
[[email protected] ~]# getenforce
Enforcing
半閉SELINUX
[[email protected] ~]# setenforce 0
[[email protected] SambaFileShare]# systemctl restart smb
[[email protected] SambaFileShare]# systemctl status smb
● smb.service - Samba SMB Daemon
Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2018-03-06 17:49:06 CST; 25s ago
Main PID: 9709 (smbd)
Status: "smbd: ready to serve connections..."
CGroup: /system.slice/smb.service
├─9709 /usr/sbin/smbd
├─9710 /usr/sbin/smbd
├─9711 /usr/sbin/smbd
└─9712 /usr/sbin/smbd
5使用
本機測試
可以使用testparm測試samba配置是否正確
[[email protected] samba]# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[SambaFileShare]"
Loaded services file OK.
WARNING: You have some share names that are longer than 12 characters.
These may not be accessible to some older clients.
(Eg. Windows9x, WindowsMe, and smbclient prior to Samba 3.0.)
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
# Global parameters
[global]
netbios name = TEDSAMBA
server string = Ted Samba Server %v
security = USER
idmap config * : backend = tdb
[SambaFileShare]
comment = share some files
path = /app/SambaFileShare
create mask = 0644
read only = No
write list = u_samba
root使用者的話,不用密碼可直接檢視samba伺服器情況
[[email protected] samba]# smbclient -L localhost
Enter root's password:
[[email protected] samba]# smbclient -L localhost
Enter WORKGROUP\root's password:
Anonymous login successful
OS=[Windows 6.1] Server=[Samba 4.6.2]
Sharename Type Comment
--------- ---- -------
SambaFileShare Disk share some files
IPC$ IPC IPC Service (Ted Samba Server 4.6.2)
Anonymous login successful
OS=[Windows 6.1] Server=[Samba 4.6.2]
Server Comment
--------- -------
Workgroup Master
--------- -------
Windows訪問
1)在Windwos資源管理器訪問 ,網路
訪問路徑裡填上: \\${Samba伺服器的IP} ,然後回車,可以看見共享的目錄
相關推薦
CentOS 7.4 安裝配置Samba伺服器
[[email protected] ~]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core)[[email protected] ~]# yum -y install samba
CentOS 6.8安裝配置samba伺服器
1、關閉防火牆 # service iptables status //檢視防火牆的狀態 # service iptables stop //停止防火牆 # chkconfig iptables off //永久關閉防火牆 2、關閉SELINUX # sestatu
centos 7.4安裝jdk配置相關
下載jdk http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 進入伺服器/usr/local目錄 cd /usr/local/ 建立jav
Centos 7.5安裝配置MongoDB 4.0.4
解壓 分布式 pwd tgz remote des work nan run MongoDB 是一個基於分布式文件存儲的數據庫。由 C++ 語言編寫。旨在為 WEB 應用提供可擴展的高性能數據存儲解決方案。MongoDB 是一個介於關系數據庫和非關系數據庫之間的產品,是非關
CentOS 7.4 安裝 Nginx(配置單域名多HTTPS主機)
1. 下載 openssl 並解壓,並將解壓後的資料夾改名為 openssl-111。wget https://www.openssl.org/source/openssl-1.1.1-pre8.tar.gztar -zxvf openssl-1.1.1-pre8.tar.g
yum centos 7.4 安裝svn伺服器
1.檢視linux版本 cat /etc/redhat-release 檢視CentOS版本 cat /proc/version 可以看出centos是7.4的,linux為64位的 2. 檢查是否已安裝 如果沒有顯示內容,說明沒有安裝。 #
CentOS 7.4 安裝後優化配置
1.網絡卡 [[email protected] ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens32 顯示結果: TYPE="Ethernet" BOOTPROTO="static" NAME="ens32
CentOS 7 yum安裝配置mysql
service 軟件包 search 源文件 傳送門 首先去官網下載要用的yum源 傳送門:http://dev.mysql.com/downloads/repo/yum/ yum源文件:/home/mysql57-community-release-el7-8.noarch.rpm 是一
CentOS 7.3安裝配置Powerline
bash vim powerline 一、Powerline簡介及演示環境:Powerline是一個極棒的Vim編輯器的狀態欄插件,主要用於顯示狀態行和提示信息。特點:使用Python編寫,使其更具擴展性且功能豐富穩定易測的代碼庫,兼容Python 2.6+和Python 3支持多種Linux功能
CentOS 6.4安裝配置LNMP服務器(Nginx+PHP+MySQL)
mysql- ket 是否 分號 使用 store 重啟 isa tpi 一 安裝篇 1. 安裝nginx yum check-update #更新yum源 yum remove httpd* php* #刪除系統自帶的軟件包 yum install nginx #安裝ng
Centos 7.4 安裝ipython和mysql-python遇到的問題
centos 7.4 安裝ipythonpip安裝ipython報錯記錄#pip install ipython==5.5.0Collecting ipython==5.5.0 Downloading http://mirrors.aliyun.com/pypi/packages/08/2c/628550
使用Docker 方式在Centos 7.0 安裝配置Sentry
sentry docker一、簡介sentry是一個強大的分布式報錯信息收集平臺,圖形化程度很高,可以幫助我們直觀的發現當前部署的系統存在哪些問題。二、安裝方式介紹官網鏈接:https://docs.sentry.io/官方提供了兩種安裝方式:Docker 和 python註:我這裏選擇使用Docker
Centos 7.4 部署配置Software Raid
welcom white centos 系統 app ssi work num -o list 本章Blog相關知識點:Raid是英文Redundant Array of Independent Disks 的縮寫,翻譯成中文意思是“獨立磁盤冗余陣列”,有時也簡稱磁盤陣列(
CentOS 7系統安裝配置圖文詳解
安裝CentOS一、安裝CentOS 7成功引導系統後,會出現下面的界面界面說明:Install CentOS Linux 7 #安裝CentOS 7 Test this media & install CentOS Linux 7 #測試安裝文件並安裝CentOS7 Troublesh
CentOS 7.4 安裝 yum Zabbix 3.4
linux zabbix 監控Download and install Zabbixhttps://www.zabbix.com/download 安裝 安裝mariadb yum install mariadb-server mariadb –y systemctl enable mariadb syste
CentOS 6.4安裝配置MairaDB 10.3 Galera Cluster
MariaDB10.3 Galera Cluster 一. 安裝環境不同版本的操作系統(CentOS 6 與 7)、不同版本的數據庫(MariaDB 10.1前後)相關安裝配置命令不太一樣。1. 操作系統:CentOS 6.42. 數據庫 : MariaDB 10.3.7二. 服務器規劃Mar
Centos 7.4安裝練習
accept S3 自定義 默認 是否 mark fff centos 掩碼 安裝CentOS7.4步驟: 打開虛擬機軟件VMware Workstation 點擊 左上角"文件-新建虛擬機", 選擇"自定義"下一步。 默認選擇"下一步"。 選擇"稍後安裝操作系統-下一步"
CentOS 7.4 安裝 Apache Cassandra 3.7
name 文件 x64 interval ram nproc ora ace eba 近期公司提出利用Cassandra 做數據匯總分析,查閱一些文檔,總結了一下安裝過程不妥之處,敬請賜教! 環境版本信息:OS:CentOS Linux release 7.4.1708ca
【Linux】CentOS 7.4 安裝 MySQL 8.0.12 解壓版
style prope error shared false 添加 tab code plain 安裝環境/工具 1、Linux(CentOS 7.4版) 2、mysql-8.0.12-el7-x86_64.tar.gz 安裝步驟 參考:https://dev.
centos 7.4 安裝mysql5.6(二進位制方式安裝)
一、在/usr/joe目錄下下載mysql wget https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.62-linux-glibc2.12-x86_64.tar.gz 二、解壓mysql tar -zvxf mysql-5.