0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SambaでUbuntu - Windows11のファイル共有をやった手順と詰まったこと

Last updated at Posted at 2025-08-31

やりたかったこと

メインPCのストレージ容量不足を懸念して、現在動いているUbuntu-serverのディレクトリを共有として使い、容量不足問題を改善しようとした

手順

Ubuntu側

sudo apt update
sudo apt install samba -y

# 適切なパーミッション、所有者を設定すること
sudo chmod 777 /srv/samba/share
sudo chown nobody:nogroup /srv/samba/share

vim /etc/samba/smb.conf
# 下記を追加
# -------
[Share]
   path = /srv/samba/share
   browseable = yes
   read only = no
   guest ok = yes
# -------
sudo systemctl restart smbd

Windows11側

エクスプローラーから該当サーバのIPを入力してみたら

\\<IP>\srv\samba\share

image.png

課題解決

1. 組織のセキュリティポリシーによって云々

これは明白だった。SMB用のユーザを作成してなかった

# Ubuntu側で存在しているusernameを使って
sudo smbpasswd -a <username>

2. 指定ディレクトリにアクセスできません

課題1を解決した後でアクセスできないといわれてしまった。
image.png

原因はフルパス指定をしたからみたい
下記で入れた

\\IP\share

課題2について調査

疑問としては1つ浮かんだ

  • なんでフルパス指定だったら入れないんだ?

疑問1の調査(なんでフルパス指定じゃない?)

smb.confのdocsを見てみると下記の記載がある

The following sample section defines a file space share. The user has write access to the path /home/bar. The share is accessed via the share name foo:

[foo]
path = /home/bar
read only = no

なので、この場合はfooの共有フォルダ名ではいれますよってことか

追加で思うのは[foo]指定ならfooで入れるが、今回[Share]指定なのにshareで入れるのはなんでだろう。

追加疑問の調査(大文字・小文字の区別ある?)

上記と同じdocsに下記の記載があった

Section and parameter names are not case sensitive.

smb.confで指定しているパラメータに大文字・小文字の区別はないから、今回shareで入れたわけか。

おわり

手順についても理解したので、良しとしたい。
同様の事象で困っている方の助けになればうれしい

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?