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?

More than 5 years have passed since last update.

CentOS 7 インストール記録 4. samba

Posted at

イントラネット環境下で、mac の launchctl と、共有フォルダの代替を検討するために。

ACL

ACL(Access Control Lists) を一応確認。

フォーマット確認

$ df -T

ACL に対応してる xfs 。

コマンド確認

$ which getfacl
/usr/bin/getfacl
$ which setfacl
/usr/bin/setfacl

samba

$ yum update
$ yum list installed | grep samba

samba 一式がインストールされている事を確認。

設定

# mkdir /home/share 
# chmod 777 /home/share 
# cd /etc/samba
# cp smb.conf smb.conf.bak

編集後

# diff smb.conf smb.conf.bak
66,71c66
< dos charset = CP932
< unix charset = UTF8
< unix extensions = no
< unix password sync = yes
< passwd program = /usr/bin/passwd %u
< passwd chat = *new*password* %n\n *new*password %n\n *succes*fully*
---
> 
94,95c89
< 	workgroup = XXXXXX 
< 	hosts allow = XXX.XXX.XXX.
---
> 	workgroup = MYGROUP
288,292c282,285
< ;[homes]
< ;	comment = Home Directories
< ;	readonly = no
< ;	browseable = no
< ;	writable = yes
---
> [homes]
> 	comment = Home Directories
> 	browseable = no
> 	writable = yes
328,335d320
< 
< [Share]
< 	path = /home/share
< 	writable = yes
< 	create mode = 0777
< 	directory mode = 0777
< 

ワークグループとホストは伏せ字に。

有効化

# systemctl start smb 
# systemctl start nmb 
# systemctl enable smb 
# systemctl enable nmb 
# systemctl status smb 

で確認

centos 6 では。

# /etc/rc.d/init.d/smb start
SMB サービスを起動中:                                      [  OK  ]
# /etc/rc.d/init.d/nmb start
NMB サービスを起動中:                                      [  OK  ]

サービスの自動起動

# chkconfig smb on
# chkconfig nmb on

samba パスワード設定

ルートのパスワードを設定
ユーザのパスワードを設定

# smbpasswd -a root
New SMB password:
Retype new SMB password:
Added user root 
# smbpasswd -a XXXXXX
New SMB password:
Retype new SMB password:
Added user XXXXXX 

しかし、今一パスワード回りが同期してくれない感じなのだが、どうしたもんだろう、、、

firewalld

firewalld を切る前にもちょこちょこ弄っていたので、 firewalld の備忘として。

firewall が動いているか。

# firewall-cmd --state
running

今のゾーン

# firewall-cmd --get-active-zone
public
  interfaces: eno1

現在有効なサービス

# firewall-cmd --list-services
dhcpv6-client ssh
# firewall-cmd --add-service=samba
success
# firewall-cmd --permanent --add-service=samba
success
# getsebool samba_enable_home_dirs
samba_enable_home_dirs –> off 

これがOFFになっているとNG。

アクセスを許可する

# setsebool -P samba_enable_home_dirs 1 
# setsebool -P samba_export_all_rw 1
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?