Инструменты пользователя

Инструменты сайта


wiki:samba

SAMBA

  • sudo apt install samba
  • sudo systemctl enable smbd
  • sudo systemctl start smbd

Конфигурационный файл (пример)

mcedit /etc/samba/smb.conf
#mkdir /home/files/it
#chmod 777 /home/files/it
#dnf install samba
#systemctl enable smb --now
#systemctl status smb
#В секцию [global] добавляем:
#...
#map to guest = Bad Password
#...
#groupadd it
#adduser admin
#passwd admin
#smbpasswd -a admin
#usermod -aG it admin
#[root@share samba]# id admin
#uid=1003(admin) gid=1007(admin) группы=1007(admin),1002(it)

#groupadd snab
#adduser snabuser
#passwd snabuser
#smbpasswd -a snabuser
#usermod -aG snab snabuser
#[root@share samba]# id snabuser
#uid=1000(snabuser) gid=1004(snabuser) группы=1004(snabuser),1000(snab)

#sudo systemctl restart smb nmb


# 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.
#
# Note:
# SMB1 is disabled by default. This means clients without support for SMB2 or
# SMB3 are no longer able to connect to smbd (by default).

[global]
#	server min protocol = NT1
#	client min protocol = NT1
	workgroup = SAMBA
	security = user
	map to guest = Bad Password
	passdb backend = tdbsam
	printing = cups
	printcap name = cups
	load printers = yes
	cups options = raw
	# Install samba-usershares package for support
	include = /etc/samba/usershares.conf

#[homes]
#	comment = Home Directories
#	valid users = %S, %D%w%S
#	browseable = No
#	read only = No
#	inherit acls = Yes

#[printers]
#	comment = All Printers
#	path = /var/tmp
#	printable = Yes
#	create mask = 0600
#	browseable = No

[public]
	comment = Public Folder
	path = /home/files/public
	public = yes
        writable = yes
        read only = no
        writable = yes
        guest ok = yes
        writable = yes
        create mask = 0777
        directory mask = 0777
        force create mode = 0777
        force directory mode = 0777

[it]
	comment = IT
	force create mode = 0777
	directory mask = 0777
	path = /home/files/it
	public = no
	guest ok = no
	browseable = no
	writable = no
	write list = @it
	inherit owner = yes
	valid users = @it
	create mask = 0777
	force directory mode = 0777

[snab]
	comment = Снабжение
	force create mode = 0777
	directory mask = 0777
	path = /home/files/snab
	public = no
	guest ok = no
	browseable = yes
	writable = no
	write list = @snab
	inherit owner = yes
	valid users = @snab
	create mask = 0777
	force directory mode = 0777


wiki/samba.txt · Последнее изменение: odmin