●設定ファイル
[root@ora12ee01 ~]# vi /etc/samba/smb.conf
●確認コマンド
[root@ora12ee01 ~]# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[Share]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
# Global parameters
[global]
disable spoolss = Yes
dos charset = CP932
load printers = No
netbios name = FS
security = USER
server string = SAMBA SERVER Version %v
wins support = Yes
idmap config * : backend = tdb
log file = /var/log/samba/log.%m
log level = 3
max log size = 1
[homes]
browseable = No
comment = Home Directories
inherit acls = Yes
read only = No
valid users = %S %D%w%S
[Share]
comment = Share Folder for All Users
path = /home/share
read only = No
●ファイルサーバ用共有ディレクトリ作成
[root@ora12ee01 ~]# mkdir /home/share
[root@ora12ee01 ~]# chmod 0777 /home/share
[root@ora12ee01 ~]# chown nobody:nobody /home/share
●ユーザ作成
[root@ora12ee01 ~]# useradd smbtest01
[root@ora12ee01 ~]# passwd smbtest01
ユーザー smbtest01 のパスワードを変更。
新しいパスワード:
よくないパスワード: このパスワードには一部に何らかの形でユーザー名が含まれています。
新しいパスワードを再入力してください:
passwd: すべての認証トークンが正しく更新できました。
↓pdbedit プログラムは SAM データベース内に保持されるユーザーアカウントを管理するために利用され、 root だけが実行できる
[root@ora12ee01 ~]# pdbedit -a -u smbtest01 -f "test user01"
new password:
retype new password:
Unix username: smbtest01
NT username:
Account Flags: [U ]
User SID: S-1-5-21-2772549720-2378569114-2118621317-1000
Primary Group SID: S-1-5-21-2772549720-2378569114-2118621317-513
Full Name: test user01
Home Directory: \\fs\smbtest01
HomeDir Drive:
Logon Script:
Profile Path: \\fs\smbtest01\profile
Domain: FS
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: 木, 07 2月 2036 00:06:39 JST
Kickoff time: 木, 07 2月 2036 00:06:39 JST
Password last set: 火, 05 2月 2019 00:32:10 JST
Password can change: 火, 05 2月 2019 00:32:10 JST
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
↓確認
[root@ora12ee01 ~]# pdbedit -L
smbtest01:5002:test user01
[root@ora12ee01 ~]# grep smbtest01 /etc/passwd
smbtest01:x:5002:5002::/home/smbtest01:/bin/bash
[root@ora12ee01 ~]# pdbedit -L -v smbtest01
Unix username: smbtest01
NT username:
Account Flags: [U ]
User SID: S-1-5-21-2772549720-2378569114-2118621317-1000
Primary Group SID: S-1-5-21-2772549720-2378569114-2118621317-513
Full Name: test user01
Home Directory: \\fs\smbtest01
HomeDir Drive:
Logon Script:
Profile Path: \\fs\smbtest01\profile
Domain: FS
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: 木, 07 2月 2036 00:06:39 JST
Kickoff time: 木, 07 2月 2036 00:06:39 JST
Password last set: 火, 05 2月 2019 00:32:10 JST
Password can change: 火, 05 2月 2019 00:32:10 JST
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
●再起動
[root@ora12ee01 ~]# systemctl restart smb nmb
●接続テスト
※「Win+R」で「\\fs」と入力してEnter、その後ユーザ名とパスワードを入力する