今回は、ファイルサーバのプログラムsambaをインストールします。こちらはWindows用です。
まずは、インストール
[root@ace ~]# rpm -qa| grep samba
[root@ace ~]# dnf install samba
CentOS-8 - AppStream 2.9 kB/s | 4.3 kB 00:01
CentOS-8 - Base 5.3 kB/s | 3.8 kB 00:00
CentOS-8 - Extras 2.1 kB/s | 1.5 kB 00:00
Extra Packages for Enterprise Linux Modular 8 - 5.3 kB/s | 9.5 kB 00:01
Extra Packages for Enterprise Linux 8 - x86_64 15 kB/s | 5.8 kB 00:00
Extra Packages for Enterprise Linux 8 - x86_64 3.8 MB/s | 5.9 MB 00:01
依存関係が解決しました。
================================================================================
パッケージ Arch バージョン Repo サイズ
================================================================================
インストール:
samba x86_64 4.10.4-101.el8_1 BaseOS 739 k
依存関係のインストール:
:
省略
:
インストール済み:
samba-4.10.4-101.el8_1.x86_64
avahi-libs-0.7-19.el8.x86_64
cups-libs-1:2.2.6-28.el8.x86_64
libwbclient-4.10.4-101.el8_1.x86_64
samba-client-libs-4.10.4-101.el8_1.x86_64
samba-common-4.10.4-101.el8_1.noarch
samba-common-libs-4.10.4-101.el8_1.x86_64
samba-common-tools-4.10.4-101.el8_1.x86_64
samba-libs-4.10.4-101.el8_1.x86_64
完了しました!
[root@ace ~]#
パッケージからなら簡単ですね。
設定変更
設定ファイルは/etc/samba/smb.confとなります。これを直しましょう。
[root@ace ~]# cp -p /etc/samba/smb.conf /etc/samba/smb.conf.orig
[root@ace ~]# vi /etc/samba/smb.conf
[root@ace ~]# cat /etc/samba/smb.conf
# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.
[global]
workgroup = WORKGROUP
server string = ZEKE's Samba Server
netbios name = ace
hosts allow = 192.168.1.0/24 2001:2c0:cd03:ca00::/64 fe80::/64
map to guest = Bad User
guest account = nobody
ntlm auth = Yes
max log size = 50
security = user
passdb backend = tdbsam
local master = Yes
os level = 33
preferred master = Yes
domain master = Yes
wins support = Yes
wins server = 192.168.1.1 2001:2c0:cd03:ca00::ace
printing = cups
printcap name = cups
load printers = No
cups options = raw
unix charset = UTF-8
dos charset = CP932
ea support = Yes
vfs objects = catia fruit streams_xattr
fruit:locking = netatalk
fruit:encoding = native
streams_xattr:prefix = user.
streams_xattr:store_stream_type = No
hide files = /.DS_Store/Network Trash Folder/TheFindByContentFolder/TheVolumeSettingsFolder/Temporary Items/.TemporaryItems/.VolumeIcon.icns/Icon?/.FBCIndex/.FBCLockFolder/
veto files = /lost+found/
delete veto files = Yes
[homes]
comment = Home Directories
path = %H/public
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[public]
comment = Public Directory
path = /home/ftp/pub
read only = No
[Music]
comment = Public Music
path = /home/zeke/StreamRipper/Music
guest ok = yes
read only = Yes
[root@ace ~]#
MacOSのファイルサーバ(Netatalk)と連携させるために、HATさんのページを参考にさせていただきました。
サーバの自動起動設定
[root@ace ~]# systemctl is-enabled nmb
disabled
[root@ace ~]# systemctl enable nmb
Created symlink /etc/systemd/system/multi-user.target.wants/nmb.service → /usr/lib/systemd/system/nmb.service.
[root@ace ~]# systemctl start nmb
[root@ace ~]# systemctl is-enabled smb
disabled
[root@ace ~]# systemctl enable smb
Created symlink /etc/systemd/system/multi-user.target.wants/smb.service → /usr/lib/systemd/system/smb.service.
[root@ace ~]# systemctl start smb
[root@ace ~]#
sambaはnmbとsmbの2つのサービスがあるので、両方とも自動起動設定を入れて、起動しておきます。
ユーザの作成変更
[root@ace ~]# pdbedit -a zeke
new password:
retype new password:
Unix username: zeke
NT username:
Account Flags: [U ]
User SID: S-1-5-21-262430257-3981893862-1320206905-1000
Primary Group SID: S-1-5-21-262430257-3981893862-1320206905-513
Full Name: zeke
Home Directory: \\ace\zeke
HomeDir Drive:
Logon Script:
Profile Path: \\ace\zeke\profile
Domain: ACE
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: 日, 01 3月 2020 01:06:22 JST
Password can change: 日, 01 3月 2020 01:06:22 JST
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
[root@ace ~]# pdbedit -L
zeke:1000:zeke
[root@ace ~]# pdbedit -Lv
---------------
Unix username: zeke
NT username:
Account Flags: [U ]
User SID: S-1-5-21-262430257-3981893862-1320206905-1000
Primary Group SID: S-1-5-21-262430257-3981893862-1320206905-513
Full Name: zeke
Home Directory: \\ace\zeke
HomeDir Drive:
Logon Script:
Profile Path: \\ace\zeke\profile
Domain: ACE
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: 日, 01 3月 2020 01:06:22 JST
Password can change: 日, 01 3月 2020 01:06:22 JST
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
[root@ace ~]# pdbedit -x zeke
[root@ace ~]# pdbedit -L
[root@ace ~]#
sambaで使うユーザのコマンドはpdbeditです。作成はpdbedit -a ユーザ名、削除はpdbedit -x ユーザ名、一覧表示はpdbedit -Lとなります。
エクスプローラで、フォルダを開ければOKです!
お勧めのKindle本です!
コメント