Menú
08225, Terrassa (Barcelona)
Soporte Técnico
Sábados a convenir
Cita de admin en 1 julio, 2024, 11:35 am
[root@smb ~]#dnf -y install samba[root@smb ~]#
groupadd smbgroup01[root@smb ~]#
mkdir /home/share01[root@smb ~]#
chgrp smbgroup01 /home/share01[root@smb ~]#
chmod 770 /home/share01[root@smb ~]#vi /etc/samba/smb.conf[global] # line 11 : add (set charset) unix charset = UTF-8 dos charset = CP932 workgroup = SAMBA security = user # add IP addresses you allow to access hosts allow = 127. 10.0.0. ..... ..... # add to the end # any Share name you like [Share01] # specify shared directory path = /home/share01 # allow writing writable = yes # not allow guest user (nobody) guest ok = no # allow only [smbgroup01] group valid users = @smbgroup01 # set group for new files/directories to [smbgroup01] force group = smbgroup01 # set permission [770] when file created force create mode = 770 # set permission [770] when folder created force directory mode = 770 # inherit permissions from parent folder inherit permissions = yes[root@smb ~]#systemctl enable --now smb# add Samba user[root@smb ~]#
useradd alma[root@smb ~]#
smbpasswd -a almaNew SMB password:
# set passwordRetype new SMB password:
Added user alma.
[root@smb ~]#usermod -aG smbgroup01 alma
[2] If SELinux is enabled and also use [/home] like this example, Change SELinux policy.
[root@smb ~]# setsebool -P samba_enable_home_dirs on[root@smb ~]#
restorecon -R /home/share01
[3] If Firewalld is running, allow Samba service.
[root@smb ~]# firewall-cmd --add-service=sambasuccess
[root@smb ~]#firewall-cmd --runtime-to-permanentsuccess
[root@smb ~]# dnf -y install samba [root@smb ~]# groupadd smbgroup01 [root@smb ~]# mkdir /home/share01 [root@smb ~]# chgrp smbgroup01 /home/share01 [root@smb ~]# chmod 770 /home/share01 [root@smb ~]# vi /etc/samba/smb.conf [global] # line 11 : add (set charset) unix charset = UTF-8 dos charset = CP932 workgroup = SAMBA security = user # add IP addresses you allow to access hosts allow = 127. 10.0.0. ..... ..... # add to the end # any Share name you like [Share01] # specify shared directory path = /home/share01 # allow writing writable = yes # not allow guest user (nobody) guest ok = no # allow only [smbgroup01] group valid users = @smbgroup01 # set group for new files/directories to [smbgroup01] force group = smbgroup01 # set permission [770] when file created force create mode = 770 # set permission [770] when folder created force directory mode = 770 # inherit permissions from parent folder inherit permissions = yes [root@smb ~]# systemctl enable --now smb # add Samba user [root@smb ~]# useradd alma [root@smb ~]# smbpasswd -a alma New SMB password: # set password Retype new SMB password: usermod -aG smbgroup01 alma |
[2] | If SELinux is enabled and also use [/home] like this example, Change SELinux policy. |
[root@smb ~]# setsebool -P samba_enable_home_dirs on [root@smb ~]# restorecon -R /home/share01 |
[3] | If Firewalld is running, allow Samba service. |
[root@smb ~]# firewall-cmd --add-service=samba success firewall-cmd --runtime-to-permanent success |
© Informàtica Can Boada All rights reserved