|
Surface Go 2 on Ubuntu ServerでmacOSファイル共有に接続する
Surface Go 2 on Ubuntu ServerでmacOSファイル共有に接続する
概要
更新履歴
目次
はじめに
-
このドキュメントは,Microsoft Surface Go 2にUbuntu ServerをインストールしたのでファイルサーバのmacOSに接続する為のパッケージのインストールや接続を行う.
cifs-utilsインストール
- ファイル共有を行うcifsのツールをインストールする.
ujpadmin@namba:~$ sudo apt install cifs-utils🆑
[sudo] password for server:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
ffmpeg gstreamer1.0-gl gstreamer1.0-x imagemagick-6-common libaa1
libavc1394-0 libavdevice60 libavtp0 libcaca0 libcdio-cdda2t64
libcdio-paranoia2t64 libcdio19t64 libdc1394-25
libdca0 libdirectfb-1.7-7t64 libdjvulibre-text libdjvulibre21
libdv4t64 libdvdnav4 libdvdread8t64 libfaad2 libfluidsynth3 libgles2
libgraphene-1.0-0 libgssdp-1.6-0
libgstreamer-gl1.0-0 libgstreamer-plugins-bad1.0-0
libgstreamer-plugins-good1.0-0 libgupnp-1.6-0 libgupnp-igd-1.6-0
libiec61883-0 libimath-3-1-29t64 libinstpatch-1.0-2
libjack-jackd2-0 libjxr-tools libjxr0t64 liblqr-1-0 liblrdf0
libltc11 libmagickcore-6.q16-7-extra libmagickcore-6.q16-7t64
libmagickwand-6.q16-7t64 libmfx1 libmicrohttpd12t64
libmjpegutils-2.1-0t64 libmodplug1 libmpcdec6
libmpeg2encpp-2.1-0t64 libmplex2-2.1-0t64 libmysqlclient21 libneon27t64
libnice10 libopenal-data libopenal1 libopenexr-3-1-30
libopenh264-7 libopenni2-0 libpq5 libraptor2-0 libraw1394-11
libraw23t64 libshout3 libsndio7.0 libsoundtouch1 libspandsp2t64
libsrtp2-1 libtag1v5 libtag1v5-vanilla libvo-aacenc0
libvo-amrwbenc0 libwavpack1 libwildmidi2 libwmflite-0.2-7 libyajl2 libzbar0t64 libzxing3 mysql-common timgm6mb-soundfont
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
keyutils libtalloc2 libwbclient0
Suggested packages:
smbclient winbind
The following NEW packages will be installed:
cifs-utils keyutils libtalloc2 libwbclient0
0 upgraded, 4 newly installed, 0 to remove and 43 not upgraded.
Need to get 252 kB of archives.
After this operation, 745 kB of additional disk space will be used.
Do you want to continue? [Y/n] y🆑
Get:1 http://archive.ubuntu.com/ubuntu noble/main amd64 libtalloc2 amd64 2.4.2-1build2 [27.3 kB]
Get:2 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libwbclient0 amd64 2:4.19.5+dfsg-4ubuntu9.4 [71.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 cifs-utils amd64 2:7.0-2ubuntu0.2 [96.6 kB]
Get:4 http://archive.ubuntu.com/ubuntu noble/main amd64 keyutils amd64 1.6.3-3build1 [56.8 kB]
Fetched 252 kB in 2s (123 kB/s)
Selecting previously unselected package libtalloc2:amd64.
(Reading database ... 134390 files and directories currently installed.)
Preparing to unpack .../libtalloc2_2.4.2-1build2_amd64.deb ...
Unpacking libtalloc2:amd64 (2.4.2-1build2) ...
Selecting previously unselected package libwbclient0:amd64.
Preparing to unpack .../libwbclient0_2%3a4.19.5+dfsg-4ubuntu9.4_amd64.deb ...
Unpacking libwbclient0:amd64 (2:4.19.5+dfsg-4ubuntu9.4) ...
Selecting previously unselected package cifs-utils.
Preparing to unpack .../cifs-utils_2%3a7.0-2ubuntu0.2_amd64.deb ...
Unpacking cifs-utils (2:7.0-2ubuntu0.2) ...
Selecting previously unselected package keyutils.
Preparing to unpack .../keyutils_1.6.3-3build1_amd64.deb ...
Unpacking keyutils (1.6.3-3build1) ...
Setting up libwbclient0:amd64 (2:4.19.5+dfsg-4ubuntu9.4) ...
Setting up libtalloc2:amd64 (2.4.2-1build2) ...
Setting up keyutils (1.6.3-3build1) ...
Setting up cifs-utils (2:7.0-2ubuntu0.2) ...
update-alternatives: using
/usr/lib/x86_64-linux-gnu/cifs-utils/idmapwb.so to provide
/etc/cifs-utils/idmap-plugin (idmap-plugin) in auto mode
Processing triggers for libc-bin (2.39-0ubuntu8.7) ...
Processing triggers for man-db (2.12.0-4build2) ...
Scanning processes...
Scanning processor microcode...
Scanning linux images...
Running kernel seems to be up-to-date.
The processor microcode seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
ujpadmin@namba:~$
smbclientのインストール
- 共有名を調べたいときは,smbclientsをインストールする.
ujpadmin@namba:~$ sudo apt install smbclient🆑
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
ffmpeg gstreamer1.0-gl gstreamer1.0-x imagemagick-6-common libaa1
libavc1394-0 libavdevice60 libavtp0 libcaca0 libcdio-cdda2t64
libcdio-paranoia2t64 libcdio19t64 libdc1394-25
libdca0 libdirectfb-1.7-7t64 libdjvulibre-text libdjvulibre21
libdv4t64 libdvdnav4 libdvdread8t64 libfaad2 libfluidsynth3 libgles2
libgraphene-1.0-0 libgssdp-1.6-0
libgstreamer-gl1.0-0 libgstreamer-plugins-bad1.0-0
libgstreamer-plugins-good1.0-0 libgupnp-1.6-0 libgupnp-igd-1.6-0
libiec61883-0 libimath-3-1-29t64 libinstpatch-1.0-2
libjack-jackd2-0 libjxr-tools libjxr0t64 liblqr-1-0 liblrdf0
libltc11 libmagickcore-6.q16-7-extra libmagickcore-6.q16-7t64
libmagickwand-6.q16-7t64 libmfx1 libmicrohttpd12t64
libmjpegutils-2.1-0t64 libmodplug1 libmpcdec6
libmpeg2encpp-2.1-0t64 libmplex2-2.1-0t64 libmysqlclient21 libneon27t64
libnice10 libopenal-data libopenal1 libopenexr-3-1-30
libopenh264-7 libopenni2-0 libpq5 libraptor2-0 libraw1394-11
libraw23t64 libshout3 libsndio7.0 libsoundtouch1 libspandsp2t64
libsrtp2-1 libtag1v5 libtag1v5-vanilla libvo-aacenc0
libvo-amrwbenc0 libwavpack1 libwildmidi2 libwmflite-0.2-7 libyajl2 libzbar0t64 libzxing3 mysql-common timgm6mb-soundfont
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libldb2 libsmbclient0 libtevent0t64 python3-gpg python3-ldb
python3-markdown python3-samba python3-talloc python3-tdb samba-common
samba-common-bin samba-dsdb-modules samba-libs
Suggested packages:
python-markdown-doc heimdal-clients python3-dnspython
The following NEW packages will be installed:
libldb2 libsmbclient0 libtevent0t64 python3-gpg python3-ldb
python3-markdown python3-samba python3-talloc python3-tdb samba-common
samba-common-bin samba-dsdb-modules samba-libs
smbclient
0 upgraded, 14 newly installed, 0 to remove and 43 not upgraded.
Need to get 11.7 MB of archives.
After this operation, 54.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y🆑
Get:1 http://archive.ubuntu.com/ubuntu noble/main amd64 libtevent0t64 amd64 0.16.1-2build1 [42.6 kB]
Get:2 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libldb2 amd64 2:2.8.0+samba4.19.5+dfsg-4ubuntu9.4 [188 kB]
Get:3 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 samba-libs amd64 2:4.19.5+dfsg-4ubuntu9.4 [6,018 kB]
Get:4 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libsmbclient0 amd64 2:4.19.5+dfsg-4ubuntu9.4 [62.4 kB]
Get:5 http://archive.ubuntu.com/ubuntu noble/main amd64 python3-gpg amd64 1.18.0-4.1ubuntu4 [209 kB]
Get:6 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 python3-ldb amd64 2:2.8.0+samba4.19.5+dfsg-4ubuntu9.4 [41.8 kB]
Get:7 http://archive.ubuntu.com/ubuntu noble/main amd64 python3-markdown all 3.5.2-1 [72.0 kB]
Get:8 http://archive.ubuntu.com/ubuntu noble/main amd64 python3-tdb amd64 1.4.10-1build1 [15.3 kB]
Get:9 http://archive.ubuntu.com/ubuntu noble/main amd64 python3-talloc amd64 2.4.2-1build2 [12.9 kB]
Get:10 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 python3-samba amd64 2:4.19.5+dfsg-4ubuntu9.4 [2,895 kB]
Get:11 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 samba-common all 2:4.19.5+dfsg-4ubuntu9.4 [65.2 kB]
Get:12 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 samba-common-bin amd64 2:4.19.5+dfsg-4ubuntu9.4 [1,279 kB]
Get:13 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 samba-dsdb-modules amd64 2:4.19.5+dfsg-4ubuntu9.4 [317 kB]
Get:14 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 smbclient amd64 2:4.19.5+dfsg-4ubuntu9.4 [470 kB]
Fetched 11.7 MB in 5s (2,306 kB/s)
Selecting previously unselected package libtevent0t64:amd64.
(Reading database ... 134451 files and directories currently installed.)
Preparing to unpack .../00-libtevent0t64_0.16.1-2build1_amd64.deb ...
Unpacking libtevent0t64:amd64 (0.16.1-2build1) ...
Selecting previously unselected package libldb2:amd64.
Preparing to unpack .../01-libldb2_2%3a2.8.0+samba4.19.5+dfsg-4ubuntu9.4_amd64.deb ...
Unpacking libldb2:amd64 (2:2.8.0+samba4.19.5+dfsg-4ubuntu9.4) ...
Selecting previously unselected package samba-libs:amd64.
Preparing to unpack .../02-samba-libs_2%3a4.19.5+dfsg-4ubuntu9.4_amd64.deb ...
Unpacking samba-libs:amd64 (2:4.19.5+dfsg-4ubuntu9.4) ...
Selecting previously unselected package libsmbclient0:amd64.
Preparing to unpack .../03-libsmbclient0_2%3a4.19.5+dfsg-4ubuntu9.4_amd64.deb ...
Unpacking libsmbclient0:amd64 (2:4.19.5+dfsg-4ubuntu9.4) ...
Selecting previously unselected package python3-gpg.
Preparing to unpack .../04-python3-gpg_1.18.0-4.1ubuntu4_amd64.deb ...
Unpacking python3-gpg (1.18.0-4.1ubuntu4) ...
Selecting previously unselected package python3-ldb.
Preparing to unpack .../05-python3-ldb_2%3a2.8.0+samba4.19.5+dfsg-4ubuntu9.4_amd64.deb ...
Unpacking python3-ldb (2:2.8.0+samba4.19.5+dfsg-4ubuntu9.4) ...
Selecting previously unselected package python3-markdown.
Preparing to unpack .../06-python3-markdown_3.5.2-1_all.deb ...
Unpacking python3-markdown (3.5.2-1) ...
Selecting previously unselected package python3-tdb.
Preparing to unpack .../07-python3-tdb_1.4.10-1build1_amd64.deb ...
Unpacking python3-tdb (1.4.10-1build1) ...
Selecting previously unselected package python3-talloc:amd64.
Preparing to unpack .../08-python3-talloc_2.4.2-1build2_amd64.deb ...
Unpacking python3-talloc:amd64 (2.4.2-1build2) ...
Selecting previously unselected package python3-samba.
Preparing to unpack .../09-python3-samba_2%3a4.19.5+dfsg-4ubuntu9.4_amd64.deb ...
Unpacking python3-samba (2:4.19.5+dfsg-4ubuntu9.4) ...
Selecting previously unselected package samba-common.
Preparing to unpack .../10-samba-common_2%3a4.19.5+dfsg-4ubuntu9.4_all.deb ...
Unpacking samba-common (2:4.19.5+dfsg-4ubuntu9.4) ...
Selecting previously unselected package samba-common-bin.
Preparing to unpack .../11-samba-common-bin_2%3a4.19.5+dfsg-4ubuntu9.4_amd64.deb ...
Unpacking samba-common-bin (2:4.19.5+dfsg-4ubuntu9.4) ...
Selecting previously unselected package samba-dsdb-modules:amd64.
Preparing to unpack .../12-samba-dsdb-modules_2%3a4.19.5+dfsg-4ubuntu9.4_amd64.deb ...
Unpacking samba-dsdb-modules:amd64 (2:4.19.5+dfsg-4ubuntu9.4) ...
Selecting previously unselected package smbclient.
Preparing to unpack .../13-smbclient_2%3a4.19.5+dfsg-4ubuntu9.4_amd64.deb ...
Unpacking smbclient (2:4.19.5+dfsg-4ubuntu9.4) ...
Setting up python3-talloc:amd64 (2.4.2-1build2) ...
Setting up samba-common (2:4.19.5+dfsg-4ubuntu9.4) ...
Creating config file /etc/samba/smb.conf with new version
Setting up python3-tdb (1.4.10-1build1) ...
Setting up python3-gpg (1.18.0-4.1ubuntu4) ...
Setting up python3-markdown (3.5.2-1) ...
Setting up libtevent0t64:amd64 (0.16.1-2build1) ...
Setting up libldb2:amd64 (2:2.8.0+samba4.19.5+dfsg-4ubuntu9.4) ...
Setting up samba-libs:amd64 (2:4.19.5+dfsg-4ubuntu9.4) ...
Setting up python3-ldb (2:2.8.0+samba4.19.5+dfsg-4ubuntu9.4) ...
Setting up samba-dsdb-modules:amd64 (2:4.19.5+dfsg-4ubuntu9.4) ...
Setting up libsmbclient0:amd64 (2:4.19.5+dfsg-4ubuntu9.4) ...
Setting up python3-samba (2:4.19.5+dfsg-4ubuntu9.4) ...
Setting up smbclient (2:4.19.5+dfsg-4ubuntu9.4) ...
Setting up samba-common-bin (2:4.19.5+dfsg-4ubuntu9.4) ...
Processing triggers for man-db (2.12.0-4build2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.7) ...
Scanning processes...
Scanning processor microcode...
Scanning linux images...
Running kernel seems to be up-to-date.
The processor microcode seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
ujpadmin@namba:~$
ファイルサーバになっているmacOSのファイル共有をUbuntuから接続(マウント)する
サーバの共有一覧を表示させる
smbclient -L //192.168.x.x -U macのユーザー名
ujpadmin@namba:~$ smbclient -L //192.168.20.47 -U ujpadmin🆑
Password for [WORKGROUP\ujpadmin]:🔑
Sharename Type Comment
--------- ---- -------
Hyperion2023 Disk
IPC$ IPC
mtgのパブリックフォルダ Disk
ujpadmin adminのパブリックフォルダ Disk
ujpadmin Disk
SMB1 disabled -- no workgroup available
- SMB1という古い脆弱性のあるプロトコルはmacOSで利用できない設定になってる.
共有ポイントを作成する
ujpadmin@namba:~$ mkdir -p ~/mnt/macshare🆑
ujpadmin@namba:~$
UbuntsuからmacOSに接続して共有ポイントにマウントする
$ sudo mount -t cifs "//192.168.20.47/ujp adminのパブリックフォルダ" ~/mnt/macshare -o username=ujpadmin
Password for ujpadmin@//192.168.20.47/ujp adminのパブリックフォルダ:🔑
ujpadmin@namba:~$
- ここではmacOS側で用意されたファイル共有が2バイト文字とスペースが入っているので,ダブルクォーテーションで囲っている.
- マウントしたディレクトリを確認する.
ujpadmin@namba:~/mnt/macshare$ ls -la🆑
total 12
drwxr-xr-x 2 root root 0 Dec 2 13:54 .
drwxrwxr-x 3 ujpadmin ujpadmin 4096 Apr 28 18:08 ..
drwxr-xr-x 2 root root 0 Apr 24 22:56 'Drop Box'
-rwxr-xr-x 1 root root 6148 Apr 17 12:49 .DS_Store
-rwxr-xr-x 1 root root 0 Jul 1 2021 .localized
ujpadmin@namba:~/mnt/macshare$
|
|