ここでは、必要最低限かつ十分なファイル共有サーバの設定をします。実行履歴を見れば明らかなように、Unixユーザのホームディレクトリと、共有ディレクトリ(/srv/ftp)を公開しているのみです。
> sudo /etc/samba/smb.conf
1 # smb.conf is the main Samba configuration file. You find a full commented
2 # version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
3 # samba-doc package is installed.
4 # Date: 2005-11-11
5 [global]
6 workgroup = HOMELAN
7 server string = Samba %v on %h
8 hosts allow = 192.168.1. 127.
9
10 unix charset = utf-8
11 dos charset = cp932
12 display charset = utf-8
13 add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
14 domain logons = No
15 domain master = No
16 security = user
17 unix password sync = No
18
19 [homes]
20 comment = Home Directories
21 valid users = %S
22 browseable = No
23 read only = No
24 writable = Yes
25 inherit acls = Yes
26
27 [share]
28 comment = Shared Directory
29 path = /srv/ftp
30 read only = No
31 writable = Yes
32 force user = root
33
34 ## Share disabled by YaST
35 # [netlogon]
:wq
> sudo /etc/init.d/smb restart
Shutting down Samba SMB daemon done
Starting Samba SMB daemon done
smbpasswdコマンドで、sambaユーザを追加します。sambaユーザに追加できるのはunixユーザのみです。
# smbpasswd --help
smbpasswd: invalid option -- -
When run by root:
smbpasswd [options] [username]
otherwise:
smbpasswd [options]
options:
-L local mode (must be first option)
-h print this usage message
-s use stdin for password prompt
-c smb.conf file Use the given path to the smb.conf file
-D LEVEL debug level
-r MACHINE remote machine
-U USER remote username
extra options when run by root or in local mode:
-a add user
-d disable user
-e enable user
-i interdomain trust account
-m machine trust account
-n set no password
-w PASSWORD ldap admin password
-x delete user
-R ORDER name resolve order
# smbpasswd -a ${user}