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でゲスト共有する

Last updated at Posted at 2025-04-13

Linux(samba)の設定

/etc/samba/smb.conf の設定

[ global ] セクション

項目
bind interfaces only Yes
interfaces 127.0.0.0/8 192.168.0.0/16
server role standalone server
unix password sync Yes
server min protocol SMB3
map to guest bad user
guest account nobody
  • unix password sync
    SMBパスワードの更新時に、Samba が UNIX のパスワードを SMB パスワードと同期させるようになる。
  • map to guest
    bad user : 存在するユーザーに対する不正なパスワードによるログイン要求は拒否する。
    指定されたユーザーが存在しなかった場合はゲストログインとして扱い、guest account で指定されたアカウントにマッピングする。
    Never : 不正なパスワードによるユーザーのログイン要求を拒否する。

共有設定

項目
[share] 共有名
comment コメント
path パス
browseable yes
guest ok yes
public yes guest ok のalias
read only yes / no
writable no / yes

ユーザ

ユーザ /etc/passwd smbpasswd
nobody 必要 不要
guest 不要 不要

ゲスト接続で接続
┗ (たぶん)guestで接続、OSユーザなし。
.┗ map to guest の設定によって、sambaのゲストログインとして扱い
.┗ nobody(geust accountで設定) にマッピング

  • OSユーザ「geust]を作成すると、OS認証が必要となりsambaのゲストアクセスにならなず、ID:guest/pass:****のアクセルになってしまう。

コマンド

  • smbstatus : 接続状態の表示
  • smbpasswd : sambaユーザのパスワード変更。「unix password sync=sync」にすると、OSパスワードも変更。
  • pdbedit : sambaユーザのコントロール。smbpasswdでは disablはできるが、削除ができない。
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?