CentOS 7 6 SAMBA服務安裝與測試

2021-09-25 08:00:07 字數 2084 閱讀 2945

#安裝samba服務和samba客戶端

yum install samba samba-client -y
#關閉防火牆和selinux

systemctl stop firewalld

setenforence 0

#永久關閉selinux

vi /etc/selinux/config
#把enforcing改為disabled

#修改smb.conf

vi /etc/samba/smb.conf
# see smb.conf.example for a more detailed config file or

# read the smb.conf manpage.

# run 'testparm' to verify the config is correct after

# you modified it.

[global]

workgroup = workgroup

security = user

passdb backend = tdbsam

# printing = cups

# printcap name = cups

# load printers = yes

# cups options = raw

[homes]

comment = home directories

valid users = %s, %d%w%s

browseable = no

read only = no

inherit acls = yes

#不需要印表機共享,注釋掉

#[printers]

# comment = all printers

# path = /var/tmp

# printable = yes

# create mask = 0600

# browseable = no

##[print$]

# comment = printer drivers

# path = /var/lib/samba/drivers

# write list = @printadmin root

# force group = @printadmin

# create mask = 0664

# directory mask = 0775

#啟動smb服務並設定開機自動啟動

systemctl start smb

systemctl enable smb

#設定samba登陸帳號

useradd test1

pdbedit -a -u test1

mkdir /home/test1

chown test1 /home/test1

chgrp test1 /home/test1

#使用smbclient測試samba服務

smbclient -l 127.0.0.1 -u test1

enter workgroup\test1's password:

sharename type comment

--------- ---- -------

ipc$ ipc ipc service

test1 disk home directories

reconnecting with smb1 for workgroup listing.

server comment

--------- -------

workgroup master

--------- -------

#done.

CentOS配置samba服務

yum install samba samba client y yum install samba client cifs utils y 3.伺服器端編輯配置檔案 vim etc samba smb.conf workgroup workgroup windows工作組模式 hosts allo...

CentOS7 6 搭建SFTP服務

1.需求 2.操作步驟 建立使用者組sftp groupadd sftp建立使用者demo1 demo2 useradd g sftp d data sftp demo1 m s sbin nologin demo1 useradd g sftp d data sftp demo2 m s sbin...

CentOS 開啟samba共享服務

yum y install samba 安裝samba服務 vim etc samba smb.conf 編輯配置檔案 security share 匿名訪問方式共享,不需要驗證使用者密碼 files 共享名稱 path home files 真正共享的目錄資料夾 public yes 公共的 wr...