読者です 読者をやめる 読者になる 読者になる

くらげになりたい。

くらげのようにふわふわ生きたい日曜プログラマなブログ。趣味の備忘録です。

Samba on Ubuntu

インストール

# apt-getでインストール
$ sudo apt-get install samba

# samba userを追加
$ sudo smbpasswd -a <user>

# Sambaの設定
$ cd /etc/samba/
$ sudo cp smb.conf smb.conf.orig
$ sudo vim smb.conf

# Sambaの再起動
$ sudo service samba restart

smb.conf

$ cd /etc/samba
$ diff -wu smb.conf.orig smb.conf
--- smb.conf.orig       2013-07-24 07:58:15.369642315 +0900
+++ smb.conf    2013-07-24 08:09:09.581550601 +0900
@@ -69,6 +69,7 @@
 # option cannot handle dynamic or non-broadcast interfaces correctly.
 ;   bind interfaces only = yes

+hosts allow = 192.168.0.0/255.255.255.0


 #### Debugging/Accounting ####
@@ -129,7 +130,8 @@

 # This option controls how unsuccessful authentication attempts are mapped
 # to anonymous connections
-   map to guest = bad user
+;   map to guest = bad user
+   map to guest = never

 ########## Domains ###########

@@ -244,13 +246,13 @@
 # Un-comment the following (and tweak the other settings below to suit)
 # to enable the default home directory shares. This will share each
 # user's home director as \\server\username
-;[homes]
-;   comment = Home Directories
-;   browseable = no
+[homes]
+   comment = Home Directories
+   browseable = no

 # By default, the home directories are exported read-only. Change the
 # next parameter to 'no' if you want to be able to write to them.
-;   read only = yes
+   read only = no

 # File creation mask is set to 0700 for security reasons. If you want to
 # create files with group=rw permissions, set next parameter to 0775.
@@ -266,7 +268,7 @@
 # The following parameter makes sure that only "username" can connect
 #
 # This might need tweaking when using external authentication schemes
-;   valid users = %S
+   valid users = %S

 # Un-comment the following and create the netlogon directory for Domain Logons
 # (you need to configure Samba to act as a domain controller too.)
@@ -289,23 +291,23 @@
 ;   create mask = 0600
 ;   directory mask = 0700

-[printers]
-   comment = All Printers
-   browseable = no
-   path = /var/spool/samba
-   printable = yes
-   guest ok = no
-   read only = yes
-   create mask = 0700
+;[printers]
+;   comment = All Printers
+;   browseable = no
+;   path = /var/spool/samba
+;   printable = yes
+;   guest ok = no
+;   read only = yes
+;   create mask = 0700

 # Windows clients look for this share name as a source of downloadable
 # printer drivers
-[print$]
-   comment = Printer Drivers
-   path = /var/lib/samba/printers
-   browseable = yes
-   read only = yes
-   guest ok = no
+;[print$]
+;   comment = Printer Drivers
+;   path = /var/lib/samba/printers
+;   browseable = yes
+;   read only = yes
+;   guest ok = no
 # Uncomment to allow remote administration of Windows print drivers.
 # You may need to replace 'lpadmin' with the name of the group your
 # admin users are members of.