ユーザ用ツール

サイト用ツール


linux:ubuntu12.04:install-samba

samba をインストール(Ubuntu 12.04 LTS)

1. apt でインストール

# apt install samba
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  attr ibverbs-providers libavahi-client3 libavahi-common-data libavahi-common3
  libboost-iostreams1.71.0 libboost-thread1.71.0 libcephfs2 libcups2 libibverbs1 libjansson4 libldb2
  libnl-route-3-200 librados2 librdmacm1 libtalloc2 libtevent0 libwbclient0 python3-crypto
  python3-dnspython python3-gpg python3-ldb python3-markdown python3-packaging python3-pygments
  python3-pyparsing python3-samba python3-talloc python3-tdb samba-common samba-common-bin
  samba-dsdb-modules samba-libs samba-vfs-modules tdb-tools
Suggested packages:
  cups-common python-markdown-doc python-pygments-doc ttf-bitstream-vera python-pyparsing-doc bind9
  bind9utils ctdb ldb-tools ntp | chrony smbldap-tools winbind heimdal-clients
The following NEW packages will be installed:
  attr ibverbs-providers libavahi-client3 libavahi-common-data libavahi-common3
  libboost-iostreams1.71.0 libboost-thread1.71.0 libcephfs2 libcups2 libibverbs1 libjansson4 libldb2
  libnl-route-3-200 librados2 librdmacm1 libtalloc2 libtevent0 libwbclient0 python3-crypto
  python3-dnspython python3-gpg python3-ldb python3-markdown python3-packaging python3-pygments
  python3-pyparsing python3-samba python3-talloc python3-tdb samba samba-common samba-common-bin
  samba-dsdb-modules samba-libs samba-vfs-modules tdb-tools
0 upgraded, 36 newly installed, 0 to remove and 0 not upgraded.
Need to get 16.7 MB of archives.
After this operation, 98.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 libtalloc2 amd64 2.3.0-3ubuntu1 [29.5 kB]
Get:2 http://jp.archive.ubuntu.com/ubuntu focal/main amd64 libtevent0 amd64 0.10.1-4 [35.5 kB]
...
Get:35 http://jp.archive.ubuntu.com/ubuntu focal-updates/main amd64 samba-dsdb-modules amd64 2:4.11.6+dfsg-0ubuntu1.4 [289 kB]
Get:36 http://jp.archive.ubuntu.com/ubuntu focal-updates/main amd64 samba-vfs-modules amd64 2:4.11.6+dfsg-0ubuntu1.4 [366 kB]
Fetched 16.7 MB in 3s (5,065 kB/s)
Extracting templates from packages: 100%
Preconfiguring packages ...
Selecting previously unselected package libtalloc2:amd64.
(Reading database ... 70923 files and directories currently installed.)
Preparing to unpack .../00-libtalloc2_2.3.0-3ubuntu1_amd64.deb ...
Unpacking libtalloc2:amd64 (2.3.0-3ubuntu1) ...
Selecting previously unselected package libtevent0:amd64.
Preparing to unpack .../01-libtevent0_0.10.1-4_amd64.deb ...
Unpacking libtevent0:amd64 (0.10.1-4) ...
Selecting previously unselected package libwbclient0:amd64.
...
Selecting previously unselected package samba-vfs-modules:amd64.
Preparing to unpack .../35-samba-vfs-modules_2%3a4.11.6+dfsg-0ubuntu1.4_amd64.deb ...
Unpacking samba-vfs-modules:amd64 (2:4.11.6+dfsg-0ubuntu1.4) ...
Setting up attr (1:2.4.48-5) ...
Setting up samba-common (2:4.11.6+dfsg-0ubuntu1.4) ...

Creating config file /etc/samba/smb.conf with new version
Setting up libboost-iostreams1.71.0:amd64 (1.71.0-6ubuntu6) ...
Setting up libjansson4:amd64 (2.12-1build1) ...
Setting up libnl-route-3-200:amd64 (3.4.0-1) ...
...
Setting up python3-samba (2:4.11.6+dfsg-0ubuntu1.4) ...
Setting up samba-vfs-modules:amd64 (2:4.11.6+dfsg-0ubuntu1.4) ...
Setting up samba-common-bin (2:4.11.6+dfsg-0ubuntu1.4) ...
Checking smb.conf with testparm
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Server role: ROLE_STANDALONE

Done
Setting up samba (2:4.11.6+dfsg-0ubuntu1.4) ...
Adding group `sambashare' (GID 118) ...
Done.
Samba is not being run as an AD Domain Controller: Masking samba-ad-dc.service
Please ignore the following error about deb-systemd-helper not finding those services.
(samba-ad-dc.service masked)
Created symlink /etc/systemd/system/multi-user.target.wants/nmbd.service → /lib/systemd/system/nmbd.service.
Failed to preset unit: Unit file /etc/systemd/system/samba-ad-dc.service is masked.
/usr/bin/deb-systemd-helper: error: systemctl preset failed on samba-ad-dc.service: No such file or directory
Created symlink /etc/systemd/system/multi-user.target.wants/smbd.service → /lib/systemd/system/smbd.service.
samba-ad-dc.service is a disabled or a static unit, not starting it.
Processing triggers for ufw (0.36-6) ...
Processing triggers for systemd (245.4-4ubuntu3.2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
#

2. pdbedit でユーザー登録

# pdbedit -a namename
new password:
retype new password:
...
#

3. /etc/smb.conf で フォルダを設定

29c29
<    workgroup = WORKGROUP
---
>    workgroup = MYGROUP
33a34,36
>    dos charset = CP932
>    unix charset = UTF-8

[samba1]
comment = samba1
path = /var/samba1
invalid users = root
valid users = namename
force user = namename
force group = namename
writable = yes
browsable = no
create mask = 0777
directory mask = 0777
hide dot files = no

[samba2]
comment = samba2
path = /home/samba2/Samba
invalid users = root
valid users = samba2
writable = yes
browsable = no
hide dot files = no

testparm で、smb.conf に間違いがないか確認する。

# testparm
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Server role: ROLE_STANDALONE
...

4. samba の実行

# systemctl restart smbd nmbd

Ubuntuの起動時に自動で実行してほしいなら

# systemctl enable smbd nmbd
Synchronizing state of smbd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable smbd
Synchronizing state of nmbd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable nmbd

linux/ubuntu12.04/install-samba.txt · 最終更新: 2020/09/21 12:44 by hohog

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki