インストール

$ sudo apt-get install samba

設定

共有フォルダ

  • /home/Shared を共有フォルダにする。
    $ cd /home/
    $ sudo mkdir Shared
    $ sudo chown nobody. Shared/
    $ sudo chmod 777 Shared/

Samba 接続用ユーザ

  • Samba 接続用ユーザの確認
    $ sudo pdbedit -L
  • ユーザ hoge に Samba 接続用のパスワードを追加
    $ sudo pdbedit -a -u hoge
  • ユーザ hoge を sambashare グループに追加
    $ sudo gpasswd -a hoge sambashare

smb.conf 変更

  • /etc/samba/smb.conf
    --- smb.conf.2015-04-19 2015-04-19 23:00:20.997621958 +0900
    +++ smb.conf    2015-05-04 08:47:15.808414322 +0900
    @@ -61,6 +61,7 @@
     # This can be either the interface name or an IP address/netmask;
     # interface names are normally preferred
     ;   interfaces = 127.0.0.0/8 eth0
    +    interfaces = 127.0.0.0/8 eth0 192.168.0.
    
     # Only bind to the named interfaces and/or networks; you must use the
     # 'interfaces' option above to use this.
    @@ -68,8 +69,9 @@
     # not protected by a firewall or is a firewall itself.  However, this
     # option cannot handle dynamic or non-broadcast interfaces correctly.
     ;   bind interfaces only = yes
    +    bind interfaces only = yes
    
    -
    +    hosts allow = 192.168.0.
    
     #### Debugging/Accounting ####
    
    @@ -100,6 +102,7 @@
     # /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
     # in the samba-doc package for details.
     #   security = user
    +    security = user
    
     # You may wish to use password encryption.  See the section on
     # 'encrypt passwords' in the smb.conf(5) manpage before enabling.
    @@ -262,7 +265,8 @@
     # The following parameter makes sure that only "username" can connect
     # to \\server\username
     # This might need tweaking when using external authentication schemes
    -   valid users = %S
    +#   valid users = %S
    +    valid users = %U
    
     # Un-comment the following and create the netlogon directory for Domain Logons
     # (you need to configure Samba to act as a domain controller too.)
    @@ -331,3 +335,10 @@
     ;   preexec = /bin/mount /cdrom
     ;   postexec = /bin/umount /cdrom
    
    +[Shared]
    +       path = /home/Shared
    +       read only = no
    +       browseable = yes
    +       valid users = @sambashare
    +       share modes = yes
    +       dos filetimes = yes

リロード   新規 下位ページ作成 編集 凍結 差分 添付 コピー 名前変更   ホーム 一覧 検索 最終更新 バックアップ リンク元   ヘルプ   最終更新のRSS
Last-modified: Mon, 04 May 2015 08:51:19 JST (1205d)