cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar









Etc


Reference














.

middleware:file:samba:index.html



Middleware

Samba

Samba Command

testparm samba configuration check
smbstatus -b Check which version you are connected to


Preparation

Check SELinux

# getenforce
Enforcing              <- enable SELinux

# setenforce 0         <- disable SELinux

# getenforce
Permissive             <- disable SELinux
# vi /etc/sysconfig/selinux
#SELINUX=enforcing
SELINUX=disabled


Configuration

/etc/samba/smb.conf

Any Permit

samba4

[global]
    security = user
    map to guest = Bad User
    hosts allow = 192.168.0.
    guest ok = yes
    guest account = nobody
    log file = /var/log/samba/log.%m
    log level = 2
    load printers = no
    dns proxy = no
    dos charset = cp932         # Windows Client's character(ex for Japanese)
    unix charset = UTF-8        # Linux Clinet's character
    client min protocol = SMB3
    client max protocol = SMB3

=======================================
[tmp1]
  path = /home/tmp1
  browseable = yes
  writable = yes

[readonly]
  path = /home/readonly
  browsable = yes
  writable = no

Before samba3.6

[global]
    dos charset = CP932         # Windows Client's character(ex for Japanese)
    unix charset = UTF-8        # Linux Clinet's character
    display charset = UTF-8     # Server's character

    security = share

[share]
    path = /home/samba/share
    guest ok = Yes
    guest only = Yes
    writable = yes
    create mode = 0777
    directory mode = 0777
    share modes = yes

[share_www]
    path = /var/www/html/share
    guest ok = Yes
    guest only = Yes
    writable = yes
    create mode = 0777
    directory mode = 0777
    share modes = yes

After samba3.6

[global]
    security = user
    passdb backend = tdbsam

    map to guest = Bad User

[share]
    path = /home/share
    writable = yes
    guest ok = yes


Windows Tips

Permit Port

You need permit only 445.
If you want to access hostname, plese permit more port.

client  ---->  Permit 445 -----> Samba Server


Guest Access in SMB2

Permit Local Group Policy
  1. Open the Local Group Policy Editor (gpedit.msc).
  2. In the console tree, select Computer Configuration > Administrative Templates > Network > Lanman Workstation.
  3. For the setting, right-click Enable insecure guest logons and select Edit.
  4. Select Enabled and select OK.

Guest access in SMB2 is disabled - Windows Server | Microsoft Docs




middleware/file/samba/index.html.txt ยท Last modified: 2020/12/30 by admin

Page Tools