2020年6月4日木曜日

CentOS8 samba インストール

sh-4.4# dnf -y install samba
sh-4.4#  which smbd nmbd
/sbin/smbd
/sbin/nmbd
sh-4.4# systemctl start smb nmb
sh-4.4#  systemctl enable smb nmb
Created symlink /etc/systemd/system/multi-user.target.wants/smb.service → /usr/lib/systemd/system/smb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/nmb.service → /usr/lib/systemd/system/nmb.service.

sh-4.4# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp39s0
  sources:
  services: cockpit dhcpv6-client mysql ssh
  ports: 3389/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

sh-4.4#  firewall-cmd --add-service=samba --permanent
success
sh-4.4#  firewall-cmd --reload
success
sh-4.4#  firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp39s0
  sources:
  services: cockpit dhcpv6-client mysql samba ssh
  ports: 3389/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

sh-4.4# 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
server string = SAMBA SERVER Version %v
netbios name = fs
security = user

passdb backend = tdbsam

dos charset = CP932
wins support = yes
# printing = cups
# printcap name = cups
load printers = no
disable spoolss = yes
# cups options = raw

[Share]
comment = Share Folder for All Users
path = /home/share/
browsable = yes
read only = no

[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
sh-4.4#
sh-4.4# cd /home
sh-4.4# mkdir share
sh-4.4# chmod -R a+rwx share
sh-4.4# chown -R nobody:nobody share
sh-4.4# # systemctl restart smb nmb
sh-4.4# systemctl status smb nmb
● smb.service - Samba SMB Daemon
   Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-06-04 15:22:26 JST; 59min ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
 Main PID: 27908 (smbd)
   Status: "smbd: ready to serve connections..."
    Tasks: 4 (limit: 26213)
   Memory: 19.7M
   CGroup: /system.slice/smb.service
           ├─27908 /usr/sbin/smbd --foreground --no-process-group
           ├─27911 /usr/sbin/smbd --foreground --no-process-group
           ├─27912 /usr/sbin/smbd --foreground --no-process-group
           └─27913 /usr/sbin/smbd --foreground --no-process-group

 6月 04 15:22:26 libra.jp systemd[1]: Starting Samba SMB Daemon...
 6月 04 15:22:26 libra.jp smbd[27908]: [2020/06/04 15:22:26.332766,  0] ../../lib/util/become_daemon.c>
 6月 04 15:22:26 libra.jp smbd[27908]:   daemon_ready: daemon 'smbd' finished starting up and ready to>
 6月 04 15:22:26 libra.jp systemd[1]: Started Samba SMB Daemon.

● nmb.service - Samba NMB Daemon
   Loaded: loaded (/usr/lib/systemd/system/nmb.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-06-04 15:22:26 JST; 59min ago
     Docs: man:nmbd(8)
           man:samba(7)
           man:smb.conf(5)
 Main PID: 27909 (nmbd)
   Status: "nmbd: ready to serve connections..."
    Tasks: 1 (limit: 26213)
   Memory: 5.3M
   CGroup: /system.slice/nmb.service
           └─27909 /usr/sbin/nmbd --foreground --no-process-group

 6月 04 15:23:00 libra.jp nmbd[27909]:
 6月 04 15:23:00 libra.jp nmbd[27909]:   Samba name server LIBRA is now a local master browser for wor>
 6月 04 15:23:00 libra.jp nmbd[27909]:
 6月 04 15:23:00 libra.jp nmbd[27909]:   *****
 6月 04 15:23:00 libra.jp nmbd[27909]: [2020/06/04 15:23:00.369477,  0] ../../source3/nmbd/nmbd_become>
 6月 04 15:23:00 libra.jp nmbd[27909]:   *****
 6月 04 15:23:00 libra.jp nmbd[27909]:
 6月 04 15:23:00 libra.jp nmbd[27909]:   Samba name server LIBRA is now a local master browser for wor>
 6月 04 15:23:00 libra.jp nmbd[27909]:
 6月 04 15:23:00 libra.jp nmbd[27909]:   *****


sh-4.4# pdbedit -a -u takahab -f "Masanobu Takahashi"
new password:
retype new password:
Unix username:        takahab
NT username:       
Account Flags:        [U          ]
User SID:             S-1-5-21-3479312465-2406587434-1385072247-1000
Primary Group SID:    S-1-5-21-3479312465-2406587434-1385072247-513
Full Name:            Masanobu Takahashi
Home Directory:       \\fs\takahab
HomeDir Drive:     
Logon Script:       
Profile Path:         \\fs\takahab\profile
Domain:               FS
Account desc:       
Workstations:       
Munged dial:       
Logon time:           0
Logoff time:          木, 07  2月 2036 00:06:39 JST
Kickoff time:         木, 07  2月 2036 00:06:39 JST
Password last set:    木, 04  6月 2020 16:03:13 JST
Password can change:  木, 04  6月 2020 16:03:13 JST
Password must change: never
Last bad password   : 0
Bad password count  : 0
Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
sh-4.4# pdbedit -L
takahab:1000:Masanobu Takahashi
sh-4.4# pdbedit -L -v -w
---------------
Unix username:        takahab
NT username:       
Account Flags:        [U          ]
User SID:             S-1-5-21-3479312465-2406587434-1385072247-1000
Primary Group SID:    S-1-5-21-3479312465-2406587434-1385072247-513
Full Name:            Masanobu Takahashi
Home Directory:       \\fs\takahab
HomeDir Drive:     
Logon Script:       
Profile Path:         \\fs\takahab\profile
Domain:               FS
Account desc:       
Workstations:       
Munged dial:       
Logon time:           0
Logoff time:          木, 07  2月 2036 00:06:39 JST
Kickoff time:         木, 07  2月 2036 00:06:39 JST
Password last set:    木, 04  6月 2020 16:03:13 JST
Password can change:  木, 04  6月 2020 16:03:13 JST
Password must change: never
Last bad password   : 0
Bad password count  : 0
Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
LM hash             : XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
NT hash             : 2C356A91505CE6E3673D17DDB5BCC0E4

0 件のコメント:

コメントを投稿

シャットダウン時の後処理 (shutdown)

# vi /etc/systemd/system/drop.service [Unit] Description= stop httpgwd DefaultDependencies=no Before=shutdown.target RefuseManualStart=true ...